summaryrefslogtreecommitdiff
path: root/src/rdb.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-08-05 13:34:46 +0200
committerantirez <antirez@gmail.com>2015-08-05 13:34:46 +0200
commit15de6b108b5d67c4d21fc67b50b1297c4c052bc6 (patch)
tree81b9a4a0ebda483b939fa510f817fb97be79eaf6 /src/rdb.c
parent175707e550658cf592a6d8ac7e3284649c274dad (diff)
downloadredis-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rdb.c b/src/rdb.c
index 324206561..f48b1cda5 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -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). */