From 2ec7875cbf649a52c2e82e10810fac3fe1ba7fb2 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 29 May 2013 11:45:40 +0200 Subject: [PATCH] min-replicas-to-write: only deny write commands. I guess I needed another coffee... --- src/redis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 32931423..d3b40a1a 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1810,7 +1810,9 @@ int processCommand(redisClient *c) { /* Don't accept write commands if there are not enough good slaves and * used configured the min-slaves-to-write option. */ - if (server.repl_min_slaves_to_write && server.repl_min_slaves_max_lag && + if (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) { flagTransaction(c);