Unverified Commit fe2fdef7 authored by sundb's avatar sundb Committed by GitHub
Browse files

Assert that clusterAddNode can't fail (#8296)

Assert that clusterAddNode can't fail
parent 430dadaf
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
clusterNode *myself = NULL; clusterNode *myself = NULL;
clusterNode *createClusterNode(char *nodename, int flags); 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 clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask);
void clusterReadHandler(connection *conn); void clusterReadHandler(connection *conn);
void clusterSendPing(clusterLink *link, int type); void clusterSendPing(clusterLink *link, int type);
...@@ -961,12 +961,12 @@ void freeClusterNode(clusterNode *n) { ...@@ -961,12 +961,12 @@ void freeClusterNode(clusterNode *n) {
} }
/* Add a node to the nodes hash table */ /* Add a node to the nodes hash table */
int clusterAddNode(clusterNode *node) { void clusterAddNode(clusterNode *node) {
int retval; int retval;
retval = dictAdd(server.cluster->nodes, retval = dictAdd(server.cluster->nodes,
sdsnewlen(node->name,CLUSTER_NAMELEN), node); 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 /* Remove a node from the cluster. The function performs the high level
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment