Unverified Commit 11d399dd authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #5684 from soloestoy/ignore-multi-cmd-flags-loading-aof

multi: ignore multiState's cmd_flags when loading AOF
parents 27453139 6100be7d
...@@ -144,12 +144,12 @@ void execCommand(client *c) { ...@@ -144,12 +144,12 @@ void execCommand(client *c) {
* was initiated when the instance was a master or a writable replica and * was initiated when the instance was a master or a writable replica and
* then the configuration changed (for example instance was turned into * then the configuration changed (for example instance was turned into
* a replica). */ * 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) !(c->flags & CLIENT_MASTER) && c->mstate.cmd_flags & CMD_WRITE)
{ {
addReplyError(c, addReplyError(c,
"Transaction contains write commands but instance " "Transaction contains write commands but instance "
"is now a read-only slave. EXEC aborted."); "is now a read-only replica. EXEC aborted.");
discardTransaction(c); discardTransaction(c);
goto handle_monitor; goto handle_monitor;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment