summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2021-01-10 02:24:58 +0800
committerGitHub <noreply@github.com>2021-01-09 10:24:58 -0800
commitfe2fdef7b0b65c86eb3cc2685cf0c4efe5007b1c (patch)
tree136d64865a51383165720a9c64626d69dab89021
parent430dadaf834e6de066006d5bf700d2daa70987ca (diff)
downloadredis-fe2fdef7b0b65c86eb3cc2685cf0c4efe5007b1c.tar.gz
Assert that clusterAddNode can't fail (#8296)
Assert that clusterAddNode can't fail
-rw-r--r--src/cluster.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cluster.c b/src/cluster.c
index c327334ee..78c36e8d1 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -47,7 +47,7 @@
clusterNode *myself = NULL;
clusterNode *createClusterNode(char *nodename, int flags);
-int clusterAddNode(clusterNode *node);
+void clusterAddNode(clusterNode *node);
void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask);
void clusterReadHandler(connection *conn);
void clusterSendPing(clusterLink *link, int type);
@@ -961,12 +961,12 @@ void freeClusterNode(clusterNode *n) {
}
/* Add a node to the nodes hash table */
-int clusterAddNode(clusterNode *node) {
+void clusterAddNode(clusterNode *node) {
int retval;
retval = dictAdd(server.cluster->nodes,
sdsnewlen(node->name,CLUSTER_NAMELEN), node);
- return (retval == DICT_OK) ? C_OK : C_ERR;
+ serverAssert(retval == DICT_OK);
}
/* Remove a node from the cluster. The function performs the high level