mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Merge pull request #4976 from trevor211/fixDebugLoadaof
Critical: Fix server crash and data inconsistency in some cases.
This commit is contained in:
commit
2e0ab4a807
@ -348,7 +348,11 @@ NULL
|
||||
serverLog(LL_WARNING,"DB reloaded by DEBUG RELOAD");
|
||||
addReply(c,shared.ok);
|
||||
} else if (!strcasecmp(c->argv[1]->ptr,"loadaof")) {
|
||||
if (server.aof_state == AOF_ON) flushAppendOnlyFile(1);
|
||||
if (server.aof_state == AOF_OFF) {
|
||||
addReply(c, shared.err);
|
||||
return;
|
||||
}
|
||||
flushAppendOnlyFile(1);
|
||||
emptyDb(-1,EMPTYDB_NO_FLAGS,NULL);
|
||||
if (loadAppendOnlyFile(server.aof_filename) != C_OK) {
|
||||
addReply(c,shared.err);
|
||||
|
Loading…
Reference in New Issue
Block a user