summaryrefslogtreecommitdiff
path: root/src/cluster.h
diff options
context:
space:
mode:
authorWang Yuan <wangyuan21@baidu.com>2021-01-14 04:36:03 +0800
committerGitHub <noreply@github.com>2021-01-13 12:36:03 -0800
commit9cb9f98d2f0d9114ac4528b2f9434a2fd2edfd60 (patch)
tree1de374b772a9132b0e007509667f46b3010a9d4e /src/cluster.h
parentf5577fdbd8898112427e5807edf102f9fcd9da33 (diff)
downloadredis-9cb9f98d2f0d9114ac4528b2f9434a2fd2edfd60.tar.gz
Optimize performance of clusterGenNodesDescription for large clusters (#8182)
Optimize the performance of clusterGenNodesDescription by only checking slot ownership of each slot once, instead of checking each slot for each node.
Diffstat (limited to 'src/cluster.h')
-rw-r--r--src/cluster.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cluster.h b/src/cluster.h
index d58f350ce..716c0d49c 100644
--- a/src/cluster.h
+++ b/src/cluster.h
@@ -118,6 +118,7 @@ typedef struct clusterNode {
int flags; /* CLUSTER_NODE_... */
uint64_t configEpoch; /* Last configEpoch observed for this node */
unsigned char slots[CLUSTER_SLOTS/8]; /* slots handled by this node */
+ sds slots_info; /* Slots info represented by string. */
int numslots; /* Number of slots handled by this node */
int numslaves; /* Number of slave nodes, if this is a master */
struct clusterNode **slaves; /* pointers to slave nodes */