From 1530c0a7dd10f67ff5a1622c107478c6d8275867 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Tue, 11 Dec 2018 19:47:36 +0800 Subject: [PATCH 1/2] multi: ignore multiState's cmd_flags when loading AOF --- src/multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multi.c b/src/multi.c index c2e64187..5971f465 100644 --- a/src/multi.c +++ b/src/multi.c @@ -144,7 +144,7 @@ void execCommand(client *c) { * was initiated when the instance was a master or a writable replica and * then the configuration changed (for example instance was turned into * a replica). */ - if (server.masterhost && server.repl_slave_ro && + if (!server.loading && server.masterhost && server.repl_slave_ro && !(c->flags & CLIENT_MASTER) && c->mstate.cmd_flags & CMD_WRITE) { addReplyError(c, From 6100be7d827bc1329b156b165a4e08fd91cbc115 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Tue, 11 Dec 2018 19:53:54 +0800 Subject: [PATCH 2/2] fix typo --- src/multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multi.c b/src/multi.c index 5971f465..d7f7d4ae 100644 --- a/src/multi.c +++ b/src/multi.c @@ -149,7 +149,7 @@ void execCommand(client *c) { { addReplyError(c, "Transaction contains write commands but instance " - "is now a read-only slave. EXEC aborted."); + "is now a read-only replica. EXEC aborted."); discardTransaction(c); goto handle_monitor; }