diff --git a/src/cluster.h b/src/cluster.h index d9c6d9413..7cf412351 100644 --- a/src/cluster.h +++ b/src/cluster.h @@ -56,7 +56,7 @@ void clusterUpdateMyselfHostname(void); void clusterUpdateMyselfAnnouncedPorts(void); sds clusterGenNodesDescription(client *c, int filter, int tls_primary); sds genClusterInfoString(void); -int clusterNodeGetSlotBit(clusterNode *n, int slot); +int clusterNodeCoversSlot(clusterNode *n, int slot); void clusterUpdateMyselfHumanNodename(void); int isValidAuxString(char *s, unsigned int length); int getNodeDefaultClientPort(clusterNode *n); diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index aa6625fd1..bba4395f3 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -55,7 +55,7 @@ void clusterSendPing(clusterLink *link, int type); void clusterSendFail(char *nodename); void clusterSendFailoverAuthIfNeeded(clusterNode *node, clusterMsg *request); void clusterUpdateState(void); -int clusterNodeGetSlotBit(clusterNode *n, int slot); +int clusterNodeCoversSlot(clusterNode *n, int slot); list *clusterGetNodesInMyShard(clusterNode *node); int clusterNodeAddSlave(clusterNode *master, clusterNode *slave); int clusterAddSlot(clusterNode *n, int slot); @@ -4065,7 +4065,7 @@ void clusterFailoverReplaceYourMaster(void) { /* 2) Claim all the slots assigned to our master. */ for (j = 0; j < CLUSTER_SLOTS; j++) { - if (clusterNodeGetSlotBit(oldmaster,j)) { + if (clusterNodeCoversSlot(oldmaster, j)) { clusterDelSlot(j); clusterAddSlot(myself,j); } @@ -4843,7 +4843,7 @@ int clusterNodeClearSlotBit(clusterNode *n, int slot) { } /* Return the slot bit from the cluster node structure. */ -int clusterNodeGetSlotBit(clusterNode *n, int slot) { +int clusterNodeCoversSlot(clusterNode *n, int slot) { return bitmapTestBit(n->slots,slot); } @@ -4882,7 +4882,7 @@ int clusterDelNodeSlots(clusterNode *node) { int deleted = 0, j; for (j = 0; j < CLUSTER_SLOTS; j++) { - if (clusterNodeGetSlotBit(node,j)) { + if (clusterNodeCoversSlot(node, j)) { clusterDelSlot(j); deleted++; } @@ -5234,7 +5234,7 @@ sds clusterGenNodeDescription(client *c, clusterNode *node, int tls_primary) { for (j = 0; j < CLUSTER_SLOTS; j++) { int bit; - if ((bit = clusterNodeGetSlotBit(node,j)) != 0) { + if ((bit = clusterNodeCoversSlot(node, j)) != 0) { if (start == -1) start = j; } if (start != -1 && (!bit || j == CLUSTER_SLOTS-1)) { diff --git a/src/db.c b/src/db.c index f77db3f88..a369c9a9a 100644 --- a/src/db.c +++ b/src/db.c @@ -2197,7 +2197,7 @@ int dbExpand(const redisDb *db, uint64_t db_size, dbKeyType keyType, int try_exp dict *d; if (server.cluster_enabled) { for (int i = 0; i < CLUSTER_SLOTS; i++) { - if (clusterNodeGetSlotBit(getMyClusterNode(), i)) { + if (clusterNodeCoversSlot(getMyClusterNode(), i)) { /* We don't know exact number of keys that would fall into each slot, but we can approximate it, assuming even distribution. */ if (keyType == DB_MAIN) { d = db->dict[i];