summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-05-27 12:09:30 +0200
committerantirez <antirez@gmail.com>2020-05-27 12:09:30 +0200
commit32378b7fad48bc6c2fc7293ad827fc8674485928 (patch)
treeffa1ec6dac92a8f12b81434b3e817632656e7baf /src
parentee22a8bdd3e5aa1b1085fb5fdedd9156184e9d31 (diff)
downloadredis-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.c13
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);