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.
This commit is contained in:
Binbin 2022-07-03 20:36:42 +08:00 committed by GitHub
parent 0b645d6319
commit 679344a2b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2577,6 +2577,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
strerror(errno)); strerror(errno));
aofManifestFree(temp_am); aofManifestFree(temp_am);
sdsfree(new_base_filepath); sdsfree(new_base_filepath);
server.aof_lastbgrewrite_status = C_ERR;
server.stat_aofrw_consecutive_failures++;
goto cleanup; goto cleanup;
} }
latencyEndMonitor(latency); latencyEndMonitor(latency);
@ -2605,6 +2607,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
sdsfree(temp_incr_filepath); sdsfree(temp_incr_filepath);
sdsfree(new_incr_filepath); sdsfree(new_incr_filepath);
sdsfree(temp_incr_aof_name); sdsfree(temp_incr_aof_name);
server.aof_lastbgrewrite_status = C_ERR;
server.stat_aofrw_consecutive_failures++;
goto cleanup; goto cleanup;
} }
latencyEndMonitor(latency); latencyEndMonitor(latency);
@ -2628,6 +2632,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
bg_unlink(new_incr_filepath); bg_unlink(new_incr_filepath);
sdsfree(new_incr_filepath); sdsfree(new_incr_filepath);
} }
server.aof_lastbgrewrite_status = C_ERR;
server.stat_aofrw_consecutive_failures++;
goto cleanup; goto cleanup;
} }
sdsfree(new_base_filepath); sdsfree(new_base_filepath);