提交 1025dd77 编写于 作者: A antirez

Cluster: connect to our master ASAP after startup if we are a slave node.

上级 bac57ad1
......@@ -1362,6 +1362,18 @@ void clusterCron(void) {
}
}
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);
}
}
/* -----------------------------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册