diff options
author | antirez <antirez@gmail.com> | 2015-08-05 13:34:46 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-08-05 13:34:46 +0200 |
commit | 15de6b108b5d67c4d21fc67b50b1297c4c052bc6 (patch) | |
tree | 81b9a4a0ebda483b939fa510f817fb97be79eaf6 /src/rdb.c | |
parent | 175707e550658cf592a6d8ac7e3284649c274dad (diff) | |
download | redis-15de6b108b5d67c4d21fc67b50b1297c4c052bc6.tar.gz |
Make sure we re-emit SELECT after each new slave full sync setup.
In previous commits we moved the FULLRESYNC to the moment we start the
BGSAVE, so that the offset we provide is the right one. However this
also means that we need to re-emit the SELECT statement every time a new
slave starts to accumulate the changes.
To obtian this effect in a more clean way, the function that sends the
FULLRESYNC reply was overloaded with a more important role of also doing
this and chanigng the slave state. So it was renamed to
replicationSetupSlaveForFullResync() to better reflect what it does now.
Diffstat (limited to 'src/rdb.c')
-rw-r--r-- | src/rdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1572,7 +1572,7 @@ int rdbSaveToSlavesSockets(void) { clientids[numfds] = slave->id; fds[numfds++] = slave->fd; slave->replstate = SLAVE_STATE_WAIT_BGSAVE_END; - replicationSendFullresyncReply(slave,getPsyncInitialOffset()); + replicationSetupSlaveForFullResync(slave,getPsyncInitialOffset()); /* Put the socket in non-blocking mode to simplify RDB transfer. * We'll restore it when the children returns (since duped socket * will share the O_NONBLOCK attribute with the parent). */ |