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

Function clusterDelNodeSlots

app/redis-6.2.6/src/cluster.c:3907–3917  ·  view source on GitHub ↗

Delete all the slots associated with the specified node. * The number of deleted slots is returned. */

Source from the content-addressed store, hash-verified

3905/* Delete all the slots associated with the specified node.
3906 * The number of deleted slots is returned. */
3907int clusterDelNodeSlots(clusterNode *node) {
3908 int deleted = 0, j;
3909
3910 for (j = 0; j < CLUSTER_SLOTS; j++) {
3911 if (clusterNodeGetSlotBit(node,j)) {
3912 clusterDelSlot(j);
3913 deleted++;
3914 }
3915 }
3916 return deleted;
3917}
3918
3919/* Clear the migrating / importing state for all the slots.
3920 * This is useful at initialization and when turning a master into slave. */

Callers 2

clusterProcessPacketFunction · 0.85
clusterCommandFunction · 0.85

Calls 2

clusterNodeGetSlotBitFunction · 0.85
clusterDelSlotFunction · 0.85

Tested by

no test coverage detected