mirror of
https://github.com/fluencelabs/redis
synced 2025-03-22 10:30:49 +00:00
Cluster: connect to our master ASAP after startup if we are a slave node.
This commit is contained in:
parent
bac57ad14b
commit
1025dd7786
@ -1362,6 +1362,18 @@ void clusterCron(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dictReleaseIterator(di);
|
dictReleaseIterator(di);
|
||||||
|
|
||||||
|
/* If we are a slave node but the replication is still turned off,
|
||||||
|
* enable it if we know the address of our master and it appears to
|
||||||
|
* be up. */
|
||||||
|
if (server.cluster->myself->flags & REDIS_NODE_SLAVE &&
|
||||||
|
server.masterhost == NULL &&
|
||||||
|
server.cluster->myself->slaveof &&
|
||||||
|
!(server.cluster->myself->slaveof->flags & REDIS_NODE_NOADDR))
|
||||||
|
{
|
||||||
|
replicationSetMaster(server.cluster->myself->slaveof->ip,
|
||||||
|
server.cluster->myself->slaveof->port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user