提交 83333b08 编写于 作者: A antirez

Stop writes on MISCONF only if instance is a master.

From the point of view of the slave not accepting writes from the master
can only create a bigger consistency issue.
上级 50d140e9
...@@ -1918,10 +1918,12 @@ int processCommand(redisClient *c) { ...@@ -1918,10 +1918,12 @@ int processCommand(redisClient *c) {
} }
} }
/* Don't accept write commands if there are problems persisting on disk. */ /* Don't accept write commands if there are problems persisting on disk
* and if this is a master instance. */
if (server.stop_writes_on_bgsave_err && if (server.stop_writes_on_bgsave_err &&
server.saveparamslen > 0 server.saveparamslen > 0
&& server.lastbgsave_status == REDIS_ERR && && server.lastbgsave_status == REDIS_ERR &&
server.masterhost != NULL &&
(c->cmd->flags & REDIS_CMD_WRITE || (c->cmd->flags & REDIS_CMD_WRITE ||
c->cmd->proc == pingCommand)) c->cmd->proc == pingCommand))
{ {
...@@ -1931,7 +1933,7 @@ int processCommand(redisClient *c) { ...@@ -1931,7 +1933,7 @@ int processCommand(redisClient *c) {
} }
/* Don't accept write commands if there are not enough good slaves and /* Don't accept write commands if there are not enough good slaves and
* used configured the min-slaves-to-write option. */ * user configured the min-slaves-to-write option. */
if (server.repl_min_slaves_to_write && if (server.repl_min_slaves_to_write &&
server.repl_min_slaves_max_lag && server.repl_min_slaves_max_lag &&
c->cmd->flags & REDIS_CMD_WRITE && c->cmd->flags & REDIS_CMD_WRITE &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册