From 9804a640b120ac2f5c2211c9e243723a00b1a3ea Mon Sep 17 00:00:00 2001 From: Binbin Date: Mon, 27 Nov 2023 11:16:15 +0800 Subject: [PATCH] clusterNodeGetSlaveofMaster -> clusterNodeGetMaster --- src/cluster.h | 2 +- src/cluster_legacy.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cluster.h b/src/cluster.h index 4fe38d3f0dd..1856cd41741 100644 --- a/src/cluster.h +++ b/src/cluster.h @@ -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); diff --git a/src/cluster_legacy.c b/src/cluster_legacy.c index 05555b61dcc..e36378d84a6 100644 --- a/src/cluster_legacy.c +++ b/src/cluster_legacy.c @@ -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); } @@ -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); @@ -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; }