提交 430bec34 编写于 作者: A antirez

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.
上级 3a30be51
......@@ -2037,7 +2037,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册