MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clusterManagerSetSlotOwner

Function clusterManagerSetSlotOwner

app/redis-6.2.6/src/redis-cli.c:3590–3604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3588}
3589
3590static int clusterManagerSetSlotOwner(clusterManagerNode *owner,
3591 int slot,
3592 int do_clear)
3593{
3594 int success = clusterManagerStartTransaction(owner);
3595 if (!success) return 0;
3596 /* Ensure the slot is not already assigned. */
3597 clusterManagerDelSlot(owner, slot, 1);
3598 /* Add the slot and bump epoch. */
3599 clusterManagerAddSlot(owner, slot);
3600 if (do_clear) clusterManagerClearSlotStatus(owner, slot);
3601 clusterManagerBumpEpoch(owner);
3602 success = clusterManagerExecTransaction(owner, clusterManagerOnSetOwnerErr);
3603 return success;
3604}
3605
3606/* Get the hash for the values of the specified keys in *keys_reply for the
3607 * specified nodes *n1 and *n2, by calling DEBUG DIGEST-VALUE redis command

Calls 6

clusterManagerDelSlotFunction · 0.85
clusterManagerAddSlotFunction · 0.85
clusterManagerBumpEpochFunction · 0.85

Tested by

no test coverage detected