Skip to content

Commit

Permalink
clusterNodeGetSlaveofMaster -> clusterNodeGetMaster
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-binbin committed Nov 27, 2023
1 parent 7531c2a commit 9804a64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int clusterNodeIsMaster(clusterNode *n);
char *clusterNodeIp(clusterNode *node);
int clusterNodeIsSlave(clusterNode *node);
clusterNode *clusterNodeGetSlaveof(clusterNode *node);
clusterNode *clusterNodeGetSlaveofMaster(clusterNode *node);
clusterNode *clusterNodeGetMaster(clusterNode *node);
char *clusterNodeGetName(clusterNode *node);
int clusterNodeTimedOut(clusterNode *node);
int clusterNodeIsFailing(clusterNode *node);
Expand Down
6 changes: 3 additions & 3 deletions src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,7 +2611,7 @@ void clusterProcessPingExtensions(clusterMsg *hdr, clusterLink *link) {
*
* If sender is a replica, set the shard_id to the shard_id of its master.
* Otherwise, we'll set it now. */
if (ext_shardid == NULL) ext_shardid = clusterNodeGetSlaveofMaster(sender)->shard_id;
if (ext_shardid == NULL) ext_shardid = clusterNodeGetMaster(sender)->shard_id;

updateShardId(sender, ext_shardid);
}
Expand Down Expand Up @@ -5555,7 +5555,7 @@ void addShardReplyForClusterShards(client *c, list *nodes) {
addReplyBulkCString(c, "slots");

/* Use slot_info_pairs from the primary only */
n = clusterNodeGetSlaveofMaster(n);
n = clusterNodeGetMaster(n);

if (n->slot_info_pairs != NULL) {
serverAssert((n->slot_info_pairs_count % 2) == 0);
Expand Down Expand Up @@ -5868,7 +5868,7 @@ clusterNode *clusterNodeGetSlaveof(clusterNode *node) {
return node->slaveof;
}

clusterNode *clusterNodeGetSlaveofMaster(clusterNode *node) {
clusterNode *clusterNodeGetMaster(clusterNode *node) {
while (node->slaveof != NULL) node = node->slaveof;
return node;
}
Expand Down

0 comments on commit 9804a64

Please sign in to comment.