update block->free after some diff data are written to the child process

This commit is contained in:
张文康 2017-04-18 20:10:08 +08:00
parent 271733f4f8
commit 5f88bd320e

View File

@ -115,6 +115,7 @@ void aofChildWriteDiffData(aeEventLoop *el, int fd, void *privdata, int mask) {
if (nwritten <= 0) return; if (nwritten <= 0) return;
memmove(block->buf,block->buf+nwritten,block->used-nwritten); memmove(block->buf,block->buf+nwritten,block->used-nwritten);
block->used -= nwritten; block->used -= nwritten;
block->free += nwritten;
} }
if (block->used == 0) listDelNode(server.aof_rewrite_buf_blocks,ln); if (block->used == 0) listDelNode(server.aof_rewrite_buf_blocks,ln);
} }