From 60e5d1724cf3482ad50eab17ce9f29c0febab14d Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 14 May 2014 12:04:42 +0200 Subject: [PATCH] Cluster: don't accept cluster bus connections during startup. --- src/cluster.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index 046a36fc..1cca207f 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) {