Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
711bf140
Commit
711bf140
authored
Dec 10, 2015
by
antirez
Browse files
Fix merge of cluster migrate-to flag.
parent
6007ea3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
711bf140
...
...
@@ -801,7 +801,7 @@ int clusterNodeAddSlave(clusterNode *master, clusterNode *slave) {
sizeof
(
clusterNode
*
)
*
(
master
->
numslaves
+
1
));
master
->
slaves
[
master
->
numslaves
]
=
slave
;
master
->
numslaves
++
;
master
->
flags
|=
CLUSTER
_NODE_MIGRATE_TO
;
master
->
flags
|=
REDIS
_NODE_MIGRATE_TO
;
return
REDIS_OK
;
}
...
...
@@ -2928,7 +2928,7 @@ void clusterHandleSlaveMigration(int max_slaves) {
/* We want to migrate only if this master used to have slaves or
* if failed over a master that had slaves. This way we only migrate
* to instances that were supposed to have replicas. */
if
(
!
(
node
->
flags
&
CLUSTER
_NODE_MIGRATE_TO
))
continue
;
if
(
!
(
node
->
flags
&
REDIS
_NODE_MIGRATE_TO
))
continue
;
okslaves
=
clusterCountNonFailingSlaves
(
node
);
if
(
okslaves
==
0
&&
target
==
NULL
&&
node
->
numslots
>
0
)
...
...
@@ -3178,7 +3178,7 @@ void clusterCron(void) {
* slots, have no working slaves, but used to have at least one
* slave, or failed over a master that used to have slaves. */
if
(
okslaves
==
0
&&
node
->
numslots
>
0
&&
node
->
flags
&
CLUSTER
_NODE_MIGRATE_TO
)
node
->
flags
&
REDIS
_NODE_MIGRATE_TO
)
{
orphaned_masters
++
;
}
...
...
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