mirror of
https://github.com/fluencelabs/redis
synced 2025-05-25 16:31:19 +00:00
Fix merge of cluster migrate-to flag.
This commit is contained in:
parent
6007ea3bcb
commit
711bf140f3
@ -801,7 +801,7 @@ int clusterNodeAddSlave(clusterNode *master, clusterNode *slave) {
|
|||||||
sizeof(clusterNode*)*(master->numslaves+1));
|
sizeof(clusterNode*)*(master->numslaves+1));
|
||||||
master->slaves[master->numslaves] = slave;
|
master->slaves[master->numslaves] = slave;
|
||||||
master->numslaves++;
|
master->numslaves++;
|
||||||
master->flags |= CLUSTER_NODE_MIGRATE_TO;
|
master->flags |= REDIS_NODE_MIGRATE_TO;
|
||||||
return REDIS_OK;
|
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
|
/* 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
|
* if failed over a master that had slaves. This way we only migrate
|
||||||
* to instances that were supposed to have replicas. */
|
* 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);
|
okslaves = clusterCountNonFailingSlaves(node);
|
||||||
|
|
||||||
if (okslaves == 0 && target == NULL && node->numslots > 0)
|
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
|
* slots, have no working slaves, but used to have at least one
|
||||||
* slave, or failed over a master that used to have slaves. */
|
* slave, or failed over a master that used to have slaves. */
|
||||||
if (okslaves == 0 && node->numslots > 0 &&
|
if (okslaves == 0 && node->numslots > 0 &&
|
||||||
node->flags & CLUSTER_NODE_MIGRATE_TO)
|
node->flags & REDIS_NODE_MIGRATE_TO)
|
||||||
{
|
{
|
||||||
orphaned_masters++;
|
orphaned_masters++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user