mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:54:58 +00:00
Merge pull request #587 from saj/truncate-short-write-from-aof
Truncate short write from the AOF
This commit is contained in:
commit
ed7b308c1c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user