Commit d3203c16 authored by antirez's avatar antirez
Browse files

Fixed a problem with AOF when it is stopped via CONFIG SET appendonly no. We...

Fixed a problem with AOF when it is stopped via CONFIG SET appendonly no. We used to kill the wrong child...
parent 2e1adff8
...@@ -19,15 +19,15 @@ void stopAppendOnly(void) { ...@@ -19,15 +19,15 @@ void stopAppendOnly(void) {
server.appendseldb = -1; server.appendseldb = -1;
server.appendonly = 0; server.appendonly = 0;
/* rewrite operation in progress? kill it, wait child exit */ /* rewrite operation in progress? kill it, wait child exit */
if (server.bgsavechildpid != -1) { if (server.bgrewritechildpid != -1) {
int statloc; int statloc;
if (kill(server.bgsavechildpid,SIGKILL) != -1) if (kill(server.bgrewritechildpid,SIGKILL) != -1)
wait3(&statloc,0,NULL); wait3(&statloc,0,NULL);
/* reset the buffer accumulating changes while the child saves */ /* reset the buffer accumulating changes while the child saves */
sdsfree(server.bgrewritebuf); sdsfree(server.bgrewritebuf);
server.bgrewritebuf = sdsempty(); server.bgrewritebuf = sdsempty();
server.bgsavechildpid = -1; server.bgrewritechildpid = -1;
} }
} }
......
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