diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2012-07-27 03:56:48 -0700 |
---|---|---|
committer | Salvatore Sanfilippo <antirez@gmail.com> | 2012-07-27 03:56:48 -0700 |
commit | ed7b308c1c369d7a004b6f7a72e01ad1eddb5ac3 (patch) | |
tree | a92258d241c0d8a957cdd696e6a19139295bf410 | |
parent | 04950a9e4dfb74a132e523ccbb7932a2394b832a (diff) | |
parent | 55302e9e285d13ae5eda021420d1a3ea6ca21afc (diff) | |
download | redis-ed7b308c1c369d7a004b6f7a72e01ad1eddb5ac3.tar.gz |
Merge pull request #587 from saj/truncate-short-write-from-aof
Truncate short write from the AOF
-rw-r--r-- | src/aof.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -250,6 +250,13 @@ void flushAppendOnlyFile(int force) { strerror(errno), (long)nwritten, (long)sdslen(server.aof_buf)); + + if (ftruncate(server.aof_fd, server.aof_current_size) == -1) { + redisLog(REDIS_WARNING, "Could not remove short write " + "from the append-only file. Redis may refuse " + "to load the AOF the next time it starts. " + "ftruncate: %s", strerror(errno)); + } } exit(1); } |