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

Function clusterAddSlot

src/cluster.cpp:3945–3950  ·  view source on GitHub ↗

Add the specified slot to the list of slots that node 'n' will * serve. Return C_OK if the operation ended with success. * If the slot is already assigned to another instance this is considered * an error and C_ERR is returned. */

Source from the content-addressed store, hash-verified

3943 * If the slot is already assigned to another instance this is considered
3944 * an error and C_ERR is returned. */
3945int clusterAddSlot(clusterNode *n, int slot) {
3946 if (g_pserver->cluster->slots[slot]) return C_ERR;
3947 clusterNodeSetSlotBit(n,slot);
3948 g_pserver->cluster->slots[slot] = n;
3949 return C_OK;
3950}
3951
3952/* Delete the specified slot marking it as unassigned.
3953 * Returns C_OK if the slot was assigned, otherwise if the slot was

Callers 5

clusterLoadConfigFunction · 0.85
clusterCommandFunction · 0.85

Calls 1

clusterNodeSetSlotBitFunction · 0.85

Tested by

no test coverage detected