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.
This commit is contained in:
antirez
2015-08-05 13:34:46 +02:00
parent 175707e550
commit 15de6b108b
3 changed files with 26 additions and 17 deletions

View File

@ -1202,7 +1202,7 @@ void replicationSendNewlineToMaster(void);
long long replicationGetSlaveOffset(void);
char *replicationGetSlaveName(client *c);
long long getPsyncInitialOffset(void);
int replicationSendFullresyncReply(client *slave, long long offset);
int replicationSetupSlaveForFullResync(client *slave, long long offset);
/* Generic persistence functions */
void startLoading(FILE *fp);