Cluster: don't gossip about nodes that are not useful to the cluster.
This commit is contained in:
parent
bc922dc688
commit
a2566d6618
@ -1099,10 +1099,17 @@ void clusterSendPing(clusterLink *link, int type) {
|
|||||||
clusterMsgDataGossip *gossip;
|
clusterMsgDataGossip *gossip;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
/* Not interesting to gossip about ourself.
|
/* In the gossip section don't include:
|
||||||
* Nor to send gossip info about HANDSHAKE state nodes (zero info). */
|
* 1) Myself.
|
||||||
|
* 2) Nodes in HANDSHAKE state.
|
||||||
|
* 3) Nodes with the NOADDR flag set.
|
||||||
|
* 4) Disconnected nodes if they don't have configured slots.
|
||||||
|
*/
|
||||||
if (this == server.cluster->myself ||
|
if (this == server.cluster->myself ||
|
||||||
this->flags & REDIS_NODE_HANDSHAKE) {
|
this->flags & (REDIS_NODE_HANDSHAKE|REDIS_NODE_NOADDR) ||
|
||||||
|
(this->link == NULL &&
|
||||||
|
popcount(this->slots,sizeof(this->slots)) == 0))
|
||||||
|
{
|
||||||
freshnodes--; /* otherwise we may loop forever. */
|
freshnodes--; /* otherwise we may loop forever. */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user