Commit fc08c859 authored by antirez's avatar antirez
Browse files

AOF write error: retry with a frequency of 1 hz.

parent fe835254
...@@ -1167,12 +1167,17 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { ...@@ -1167,12 +1167,17 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
} }
/* AOF: we may have postponed buffer flush, or were not able to /* AOF postponed flush: Try at every cron cycle if the slow fsync
* write our buffer because of write(2) error. Try again here. */ * completed. */
if (server.aof_flush_postponed_start || if (server.aof_flush_postponed_start) flushAppendOnlyFile(0);
server.aof_last_write_status == REDIS_ERR)
{ /* AOF write errors: in this case we have a buffer to flush as well and
flushAppendOnlyFile(0); * clear the AOF error in case of success to make the DB writable again,
* however to try every second is enough in case of 'hz' is set to
* an higher frequency. */
run_with_period(1000) {
if (server.aof_last_write_status == REDIS_ERR)
flushAppendOnlyFile(0);
} }
/* Close clients that need to be closed asynchronous */ /* Close clients that need to be closed asynchronous */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment