mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
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.
This commit is contained in:
parent
76a3954f4a
commit
892e98548a
@ -1085,7 +1085,8 @@ void clusterSendMessage(clusterLink *link, unsigned char *msg, size_t msglen) {
|
|||||||
link->sndbuf = sdscatlen(link->sndbuf, msg, 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) {
|
void clusterBroadcastMessage(void *buf, size_t len) {
|
||||||
dictIterator *di;
|
dictIterator *di;
|
||||||
dictEntry *de;
|
dictEntry *de;
|
||||||
@ -1095,7 +1096,8 @@ void clusterBroadcastMessage(void *buf, size_t len) {
|
|||||||
clusterNode *node = dictGetVal(de);
|
clusterNode *node = dictGetVal(de);
|
||||||
|
|
||||||
if (!node->link) continue;
|
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);
|
clusterSendMessage(node->link,buf,len);
|
||||||
}
|
}
|
||||||
dictReleaseIterator(di);
|
dictReleaseIterator(di);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user