mirror of
https://github.com/fluencelabs/redis
synced 2025-06-24 22:41:32 +00:00
Fix for slaves chains. Force resync of slaves (simply disconnecting them) when SLAVEOF turns a master into a slave.
This commit is contained in:
@ -507,6 +507,7 @@ void slaveofCommand(redisClient *c) {
|
||||
server.masterhost = sdsdup(c->argv[1]->ptr);
|
||||
server.masterport = atoi(c->argv[2]->ptr);
|
||||
if (server.master) freeClient(server.master);
|
||||
disconnectSlaves(); /* Force our slaves to resync with us as well. */
|
||||
if (server.replstate == REDIS_REPL_TRANSFER)
|
||||
replicationAbortSyncTransfer();
|
||||
server.replstate = REDIS_REPL_CONNECT;
|
||||
|
Reference in New Issue
Block a user