summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-05-25 11:47:38 +0200
committerantirez <antirez@gmail.com>2020-05-25 12:08:01 +0200
commit2e591fc4a4dddb86f4917f055c62a36cde1afebf (patch)
tree5472affa8e683c441ef00c630f711bd86bb58b20
parentcbb51fb8f97eb7b3af2b30e4df0d53091f7f0d3a (diff)
downloadredis-2e591fc4a4dddb86f4917f055c62a36cde1afebf.tar.gz
Clarify what is happening in PR #7320.
-rw-r--r--src/replication.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/replication.c b/src/replication.c
index d45a15783..3ebe451a2 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -2537,7 +2537,11 @@ void replicationUnsetMaster(void) {
/* When a slave is turned into a master, the current replication ID
* (that was inherited from the master at synchronization time) is
* used as secondary ID up to the current offset, and a new replication
- * ID is created to continue with a new replication history. */
+ * ID is created to continue with a new replication history.
+ *
+ * NOTE: this function MUST be called after we call
+ * freeClient(server.master), since there we adjust the replication
+ * offset trimming the final PINGs. See Github issue #7320. */
shiftReplicationId();
/* Disconnecting all the slaves is required: we need to inform slaves
* of the replication ID change (see shiftReplicationId() call). However