From f26072eb66eec84b0d44d386ab9911a3b3ad082e Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 30 Oct 2015 11:57:36 +0100 Subject: [PATCH] More reliable DEBUG loadaof. Make sure to flush the AOF output buffers before reloading. Result: less false timing related false positives on AOF tests. --- src/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/debug.c b/src/debug.c index f00d8174..35cefe4c 100644 --- a/src/debug.c +++ b/src/debug.c @@ -293,6 +293,7 @@ void debugCommand(client *c) { 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); emptyDb(-1,EMPTYDB_NO_FLAGS,NULL); if (loadAppendOnlyFile(server.aof_filename) != C_OK) { addReply(c,shared.err);