mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
aofChildWriteDiffData() better handling of free blocks.
This commit is contained in:
parent
ac33c049c6
commit
93cd75bbe0
11
src/aof.c
11
src/aof.c
@ -104,10 +104,13 @@ void aofChildWriteDiffData(aeEventLoop *el, int fd, void *privdata, int mask) {
|
||||
AE_WRITABLE);
|
||||
return;
|
||||
}
|
||||
nwritten = write(server.aof_pipe_write_data_to_child,block->buf,block->used);
|
||||
if (nwritten <= 0) return;
|
||||
memmove(block->buf,block->buf+nwritten,block->used-nwritten);
|
||||
block->used -= nwritten;
|
||||
if (block->used > 0) {
|
||||
nwritten = write(server.aof_pipe_write_data_to_child,
|
||||
block->buf,block->used);
|
||||
if (nwritten <= 0) return;
|
||||
memmove(block->buf,block->buf+nwritten,block->used-nwritten);
|
||||
block->used -= nwritten;
|
||||
}
|
||||
if (block->used == 0) listDelNode(server.aof_rewrite_buf_blocks,ln);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user