提交 ed7b308c 编写于 作者: S Salvatore Sanfilippo

Merge pull request #587 from saj/truncate-short-write-from-aof

Truncate short write from the AOF
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册