From 8cdeddc81c6f26e600a4a80520084fceb5648a98 Mon Sep 17 00:00:00 2001 From: Sankar <1890648+srgsanky@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:03:27 -0700 Subject: [PATCH] Clear owner_not_claiming_slot bit for the slot in clusterDelSlot (#12564) Clear owner_not_claiming_slot bit for the slot in clusterDelSlot to keep it consistent with slot ownership information. --- src/cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 9cfa99a32..9366c32d1 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -2408,7 +2408,6 @@ void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoc } clusterDelSlot(j); clusterAddSlot(sender,j); - bitmapClearBit(server.cluster->owner_not_claiming_slot, j); clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG| CLUSTER_TODO_UPDATE_STATE| CLUSTER_TODO_FSYNC_CONFIG); @@ -4944,6 +4943,8 @@ int clusterDelSlot(int slot) { } serverAssert(clusterNodeClearSlotBit(n,slot) == 1); server.cluster->slots[slot] = NULL; + /* Make owner_not_claiming_slot flag consistent with slot ownership information. */ + bitmapClearBit(server.cluster->owner_not_claiming_slot, slot); return C_OK; }