From 892e98548a46bfa5a0c93f04b6d057cd96afe7fe Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 15 Mar 2013 15:36:36 +0100 Subject: [PATCH] Cluster: don't broadcast messages to HANDSHAKE nodes. Also don't check for NOADDR as we check that node->link is not NULL that's enough. --- src/cluster.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index eeb748bb..b9d96c98 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -1085,7 +1085,8 @@ void clusterSendMessage(clusterLink *link, unsigned char *msg, size_t msglen) { link->sndbuf = sdscatlen(link->sndbuf, msg, msglen); } -/* Send a message to all the nodes with a reliable link */ +/* Send a message to all the nodes that are part of the cluster having + * a connected link. */ void clusterBroadcastMessage(void *buf, size_t len) { dictIterator *di; dictEntry *de; @@ -1095,7 +1096,8 @@ void clusterBroadcastMessage(void *buf, size_t len) { clusterNode *node = dictGetVal(de); if (!node->link) continue; - if (node->flags & (REDIS_NODE_MYSELF|REDIS_NODE_NOADDR)) continue; + if (node->flags & (REDIS_NODE_MYSELF|REDIS_NODE_HANDSHAKE)) + continue; clusterSendMessage(node->link,buf,len); } dictReleaseIterator(di);