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
5ef157ba
Unverified
Commit
5ef157ba
authored
May 29, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
May 29, 2020
Browse files
Merge pull request #7330 from liuzhen/unstable
fix clusters mixing accidentally by gossip
parents
9d38a270
3984dc65
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
5ef157ba
...
@@ -1463,7 +1463,10 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
...
@@ -1463,7 +1463,10 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
}
}
}
else
{
}
else
{
/* If it's not in NOADDR state and we don't have it, we
/* 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
* Note that we require that the sender of this gossip message
* is a well known node in our cluster, otherwise we risk
* is a well known node in our cluster, otherwise we risk
...
@@ -1472,7 +1475,12 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
...
@@ -1472,7 +1475,12 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
!
(
flags
&
CLUSTER_NODE_NOADDR
)
&&
!
(
flags
&
CLUSTER_NODE_NOADDR
)
&&
!
clusterBlacklistExists
(
g
->
nodename
))
!
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
);
}
}
}
}
...
...
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