From 1200115af09f48fd2dc0fe1859a5d18b3db70e2c Mon Sep 17 00:00:00 2001 From: bleeqer Date: Tue, 30 Sep 2025 00:15:49 +0000 Subject: [PATCH] cli: check clusterManagerSetSlot return value during migration --- src/redis-cli.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index 020df8d01..e998c5271 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -5191,7 +5191,12 @@ static int clusterManagerMigrateKeysInSlot(clusterManagerNode *source, clusterManagerLogWarn("*** Slot was not served, setting " "owner to node %s:%d.\n", target->ip, target->port); - clusterManagerSetSlot(source, target, slot, "node", NULL); + int setslot_ok = clusterManagerSetSlot(source, target, slot, "node", NULL); + if (!setslot_ok) { + clusterManagerLogErr("*** Failed to set slot owner for slot%d", slot); + success = 0; + goto next; + } } /* If the key already exists in the target node (BUSYKEY), * check whether its value is the same in both nodes.