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

Function clusterAddSlot

app/redis-6.2.6/src/cluster.c:3886–3891  ·  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

3884 * If the slot is already assigned to another instance this is considered
3885 * an error and C_ERR is returned. */
3886int clusterAddSlot(clusterNode *n, int slot) {
3887 if (server.cluster->slots[slot]) return C_ERR;
3888 clusterNodeSetSlotBit(n,slot);
3889 server.cluster->slots[slot] = n;
3890 return C_OK;
3891}
3892
3893/* Delete the specified slot marking it as unassigned.
3894 * 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