mirror of
https://github.com/fluencelabs/redis
synced 2025-06-23 14:01:34 +00:00
New in INFO: aof_last_bgrewrite_status
Behaves like rdb_last_bgsave_status -- even down to reporting 'ok' when no rewrite has been done yet. (You might want to check that aof_last_rewrite_time_sec is not -1.)
This commit is contained in:
committed by
antirez
parent
889e443ce5
commit
f00b0844c9
@ -1093,6 +1093,8 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
|
||||
server.aof_buf = sdsempty();
|
||||
}
|
||||
|
||||
server.aof_lastbgrewrite_status = REDIS_OK;
|
||||
|
||||
redisLog(REDIS_NOTICE, "Background AOF rewrite finished successfully");
|
||||
/* Change state from WAIT_REWRITE to ON if needed */
|
||||
if (server.aof_state == REDIS_AOF_WAIT_REWRITE)
|
||||
@ -1104,9 +1106,13 @@ void backgroundRewriteDoneHandler(int exitcode, int bysignal) {
|
||||
redisLog(REDIS_VERBOSE,
|
||||
"Background AOF rewrite signal handler took %lldus", ustime()-now);
|
||||
} else if (!bysignal && exitcode != 0) {
|
||||
server.aof_lastbgrewrite_status = REDIS_ERR;
|
||||
|
||||
redisLog(REDIS_WARNING,
|
||||
"Background AOF rewrite terminated with error");
|
||||
} else {
|
||||
server.aof_lastbgrewrite_status = REDIS_ERR;
|
||||
|
||||
redisLog(REDIS_WARNING,
|
||||
"Background AOF rewrite terminated by signal %d", bysignal);
|
||||
}
|
||||
|
Reference in New Issue
Block a user