Unverified Commit 2e0ab4a8 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #4976 from trevor211/fixDebugLoadaof

Critical: Fix server crash and data inconsistency in some cases.
parents 94658303 7d269d5e
...@@ -348,7 +348,11 @@ NULL ...@@ -348,7 +348,11 @@ NULL
serverLog(LL_WARNING,"DB reloaded by DEBUG RELOAD"); serverLog(LL_WARNING,"DB reloaded by DEBUG RELOAD");
addReply(c,shared.ok); addReply(c,shared.ok);
} else if (!strcasecmp(c->argv[1]->ptr,"loadaof")) { } 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); emptyDb(-1,EMPTYDB_NO_FLAGS,NULL);
if (loadAppendOnlyFile(server.aof_filename) != C_OK) { if (loadAppendOnlyFile(server.aof_filename) != C_OK) {
addReply(c,shared.err); addReply(c,shared.err);
......
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