1
0
mirror of https://github.com/fluencelabs/redis synced 2025-03-31 14:51:04 +00:00

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 .
This commit is contained in:
antirez 2014-06-05 10:48:05 +02:00
parent 134fd9eaf4
commit 14fb0ac649

@ -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)