From 92a3ff6168864673e806075528574d8b70fa20b0 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 25 May 2020 11:47:38 +0200 Subject: Clarify what is happening in PR #7320. --- src/replication.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1