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

Function clusterDelNodeSlots

src/cluster.cpp:3966–3976  ·  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

3964/* Delete all the slots associated with the specified node.
3965 * The number of deleted slots is returned. */
3966int clusterDelNodeSlots(clusterNode *node) {
3967 int deleted = 0, j;
3968
3969 for (j = 0; j < CLUSTER_SLOTS; j++) {
3970 if (clusterNodeGetSlotBit(node,j)) {
3971 clusterDelSlot(j);
3972 deleted++;
3973 }
3974 }
3975 return deleted;
3976}
3977
3978/* Clear the migrating / importing state for all the slots.
3979 * 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