diff options
author | antirez <antirez@gmail.com> | 2020-05-29 11:09:15 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2020-05-29 11:09:15 +0200 |
commit | bdd541174736522c92ff786576e744269c3a1c2c (patch) | |
tree | e6a12b20760dfbb8df0cacd50c3489adc151a190 | |
parent | 1f8ea99b4bc25083d909b3228601fb82efe1e67f (diff) | |
parent | 5ef157bae1345658ef70b33d8751bd65e3fa20c5 (diff) | |
download | redis-bdd541174736522c92ff786576e744269c3a1c2c.tar.gz |
Merge branch 'unstable' of github.com:/antirez/redis into unstable
-rw-r--r-- | src/cluster.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cluster.c b/src/cluster.c index a2fab323a..24b14d1dc 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1463,7 +1463,10 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { } } else { /* If it's not in NOADDR state and we don't have it, we - * start a handshake process against this IP/PORT pairs. + * add it to our trusted dict with exact nodeid and flag. + * Note that we cannot simply start a handshake against + * this IP/PORT pairs, since IP/PORT can be reused already, + * otherwise we risk joining another cluster. * * Note that we require that the sender of this gossip message * is a well known node in our cluster, otherwise we risk @@ -1472,7 +1475,12 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { !(flags & CLUSTER_NODE_NOADDR) && !clusterBlacklistExists(g->nodename)) { - clusterStartHandshake(g->ip,ntohs(g->port),ntohs(g->cport)); + clusterNode *node; + node = createClusterNode(g->nodename, flags); + memcpy(node->ip,g->ip,NET_IP_STR_LEN); + node->port = ntohs(g->port); + node->cport = ntohs(g->cport); + clusterAddNode(node); } } |