MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / clusterManagerSetSlotOwner

Function clusterManagerSetSlotOwner

src/redis-cli.c:3201–3215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3199}
3200
3201int clusterManagerSetSlotOwner(clusterManagerNode *owner,
3202 int slot,
3203 int do_clear)
3204{
3205 int success = clusterManagerStartTransaction(owner);
3206 if (!success) return 0;
3207 /* Ensure the slot is not already assigned. */
3208 clusterManagerDelSlot(owner, slot, 1);
3209 /* Add the slot and bump epoch. */
3210 clusterManagerAddSlot(owner, slot);
3211 if (do_clear) clusterManagerClearSlotStatus(owner, slot);
3212 clusterManagerBumpEpoch(owner);
3213 success = clusterManagerExecTransaction(owner, clusterManagerOnSetOwnerErr);
3214 return success;
3215}
3216
3217/* Get the hash for the values of the specified keys in *keys_reply for the
3218 * 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