I found a possible bug in aof.c stopAppendOnly function

31 views
Skip to first unread message

musicode

unread,
Jul 2, 2011, 2:54:37 AM7/2/11
to Redis DB, ant...@gmail.com
Actually, sure kill bgrewritechildpid process, but the code is
bgsavechild, something wrong???

version 2.11

aof.c
====================================================
void stopAppendOnly(void) {
flushAppendOnlyFile();
aof_fsync(server.appendfd);
close(server.appendfd);

server.appendfd = -1;
server.appendseldb = -1;
server.appendonly = 0;
/* rewrite operation in progress? kill it, wait child exit */
if (server.bgsavechildpid != -1) {
int statloc;

if (kill(server.bgsavechildpid,SIGKILL) != -1)
wait3(&statloc,0,NULL);
/* reset the buffer accumulating changes while the child saves
*/
sdsfree(server.bgrewritebuf);
server.bgrewritebuf = sdsempty();
server.bgsavechildpid = -1;
}
}

Salvatore Sanfilippo

unread,
Jul 2, 2011, 12:05:43 PM7/2/11
to musicode, Redis DB
Hi, this bug was fixed a few weeks ago, are you using a recent
version? Thank you for spotting the bug, this kind of auditing is very
useful and appreciated.

Salvatore

--
Salvatore 'antirez' Sanfilippo
open source developer - VMware

http://invece.org
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit." -- Aristotele

Salvatore Sanfilippo

unread,
Jul 2, 2011, 12:06:38 PM7/2/11
to musicode, Redis DB
I see you mentined "2.11", I guess this is actually 2.2.11. I'm
surprised there is this bug in this version as I fixed it everywhere,
maybe I forgot the 2.2 release... thanks.

Salvatore

musicode

unread,
Jul 2, 2011, 12:32:44 PM7/2/11
to Redis DB
can fix in release 2.2.12 ?
i saw u fixed it in master branch

On Jul 3, 12:06 am, Salvatore Sanfilippo <anti...@gmail.com> wrote:
> I see you mentined "2.11", I guess this is actually 2.2.11. I'm
> surprised there is this bug in this version as I fixed it everywhere,
> maybe I forgot the 2.2 release... thanks.
>
> Salvatore
>
>
>
>
>
>
>
>
>
> On Sat, Jul 2, 2011 at 6:05 PM, Salvatore Sanfilippo <anti...@gmail.com> wrote:
> > Hi, this bug was fixed a few weeks ago, are you using a recent
> > version? Thank you for spotting the bug, this kind of auditing is very
> > useful and appreciated.
>
> > Salvatore
>
Reply all
Reply to author
Forward
0 new messages