Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a2566d66
Commit
a2566d66
authored
Feb 28, 2013
by
antirez
Browse files
Cluster: don't gossip about nodes that are not useful to the cluster.
parent
bc922dc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
a2566d66
...
...
@@ -1099,10 +1099,17 @@ void clusterSendPing(clusterLink *link, int type) {
clusterMsgDataGossip
*
gossip
;
int
j
;
/* Not interesting to gossip about ourself.
* Nor to send gossip info about HANDSHAKE state nodes (zero info). */
/* In the gossip section don't include:
* 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
||
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. */
continue
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment