From 679344a2b064735b1807ccd70ef318a5829a277b Mon Sep 17 00:00:00 2001 From: Binbin Date: Sun, 3 Jul 2022 20:36:42 +0800 Subject: [PATCH] Set aof rewrite status in some backgroundRewriteDoneHandler errors (#10923) We should also set aof_lastbgrewrite_status to C_ERR on these errors. Because aof rewrite did fail, and we did not finish the manifest update. Also maintain the stat_aofrw_consecutive_failures. --- src/aof.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/aof.c b/src/aof.c index dad9c84bf..150404bc3 100644 --- a/src/aof.c +++ b/src/aof.c @@ -2577,6 +2577,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) { strerror(errno)); aofManifestFree(temp_am); sdsfree(new_base_filepath); + server.aof_lastbgrewrite_status = C_ERR; + server.stat_aofrw_consecutive_failures++; goto cleanup; } latencyEndMonitor(latency); @@ -2605,6 +2607,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) { sdsfree(temp_incr_filepath); sdsfree(new_incr_filepath); sdsfree(temp_incr_aof_name); + server.aof_lastbgrewrite_status = C_ERR; + server.stat_aofrw_consecutive_failures++; goto cleanup; } latencyEndMonitor(latency); @@ -2628,6 +2632,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) { bg_unlink(new_incr_filepath); sdsfree(new_incr_filepath); } + server.aof_lastbgrewrite_status = C_ERR; + server.stat_aofrw_consecutive_failures++; goto cleanup; } sdsfree(new_base_filepath);