From 14fb0ac649062d250659a153aa576870e151cb4b Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 5 Jun 2014 10:48:05 +0200 Subject: [PATCH] Don't process min-slaves-to-write for slaves. Replication is totally broken when a slave has this option, since it stops accepting updates from masters. This fixes issue #1434. --- src/redis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 6a72ca53..dc9f4c95 100644 --- a/src/redis.c +++ b/src/redis.c @@ -2170,7 +2170,8 @@ int processCommand(redisClient *c) { /* Don't accept write commands if there are not enough good slaves and * user configured the min-slaves-to-write option. */ - if (server.repl_min_slaves_to_write && + if (server.masterhost == NULL && + server.repl_min_slaves_to_write && server.repl_min_slaves_max_lag && c->cmd->flags & REDIS_CMD_WRITE && server.repl_good_slaves_count < server.repl_min_slaves_to_write)