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

Function clusterDelSlot

src/cluster.cpp:3955–3962  ·  view source on GitHub ↗

Delete the specified slot marking it as unassigned. * Returns C_OK if the slot was assigned, otherwise if the slot was * already unassigned C_ERR is returned. */

Source from the content-addressed store, hash-verified

3953 * Returns C_OK if the slot was assigned, otherwise if the slot was
3954 * already unassigned C_ERR is returned. */
3955int clusterDelSlot(int slot) {
3956 clusterNode *n = g_pserver->cluster->slots[slot];
3957
3958 if (!n) return C_ERR;
3959 serverAssert(clusterNodeClearSlotBit(n,slot) == 1);
3960 g_pserver->cluster->slots[slot] = NULL;
3961 return C_OK;
3962}
3963
3964/* Delete all the slots associated with the specified node.
3965 * The number of deleted slots is returned. */

Callers 6

clusterResetFunction · 0.85
clusterDelNodeFunction · 0.85
clusterDelNodeSlotsFunction · 0.85
clusterCommandFunction · 0.85

Calls 1

clusterNodeClearSlotBitFunction · 0.85

Tested by

no test coverage detected