diff options
author | antirez <antirez@gmail.com> | 2020-05-27 12:09:30 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2020-05-27 12:09:30 +0200 |
commit | 32378b7fad48bc6c2fc7293ad827fc8674485928 (patch) | |
tree | ffa1ec6dac92a8f12b81434b3e817632656e7baf /src | |
parent | ee22a8bdd3e5aa1b1085fb5fdedd9156184e9d31 (diff) | |
download | redis-32378b7fad48bc6c2fc7293ad827fc8674485928.tar.gz |
Revert "Disconnect chained replicas when the replica performs PSYNC with the master always to avoid replication offset mismatch between master and chained replicas."
This reverts commit 42f5da5d2d373b1a016d725b2b7111288949a28e.
Diffstat (limited to 'src')
-rw-r--r-- | src/replication.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/replication.c b/src/replication.c index e32670f2e..99f233380 100644 --- a/src/replication.c +++ b/src/replication.c @@ -2084,19 +2084,12 @@ int slaveTryPartialResynchronization(connection *conn, int read_reply) { * new one. */ memcpy(server.replid,new,sizeof(server.replid)); memcpy(server.cached_master->replid,new,sizeof(server.replid)); + + /* Disconnect all the sub-slaves: they need to be notified. */ + disconnectSlaves(); } } - /* Disconnect all the sub-replicas: they need to be notified always because - * in case the master has last replicated some non-meaningful commands - * (e.g. PINGs), the primary replica will request the PSYNC offset for the - * last known meaningful command. This means the master will again replicate - * the non-meaningful commands. If the sub-replicas still remains connected, - * they will receive those commands a second time and increment the master - * replication offset to be higher than the master's offset forever. - */ - disconnectSlaves(); - /* Setup the replication to continue. */ sdsfree(reply); replicationResurrectCachedMaster(conn); |