summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-14 12:04:42 +0200
committerantirez <antirez@gmail.com>2014-05-20 17:45:50 +0200
commitbe1594905fba5929c3723ce97a9019f44f67c7c1 (patch)
tree4516e94863b566b7b79665f7381cdff01a855b9b
parentb8a71e5a77b7760ed8d963538330062191e7aa41 (diff)
downloadredis-be1594905fba5929c3723ce97a9019f44f67c7c1.tar.gz
Cluster: don't accept cluster bus connections during startup.
-rw-r--r--src/cluster.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 046a36fc9..1cca207f6 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -502,6 +502,10 @@ void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
REDIS_NOTUSED(mask);
REDIS_NOTUSED(privdata);
+ /* If the server is starting up, don't accept cluster connections:
+ * UPDATE messages may interact with the database content. */
+ if (server.masterhost == NULL && server.loading) return;
+
while(max--) {
cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
if (cfd == ANET_ERR) {