diff options
author | antirez <antirez@gmail.com> | 2015-10-30 09:41:04 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-10-30 12:06:08 +0100 |
commit | 2dabf82d5f9f9eb63efb32f7b172a54f000f607f (patch) | |
tree | 39394e08af66d132b14a0896971d76fd41b0ce33 /src/scripting.c | |
parent | 514a23472262de499005a31b1af3cca08a1c84ba (diff) | |
download | redis-2dabf82d5f9f9eb63efb32f7b172a54f000f607f.tar.gz |
Fix call() FORCE_REPL/AOF flags setting.
This commit also inverts two stanzas of the code just becuase they are
more logical like that, not because currently it makes any difference.
Diffstat (limited to 'src/scripting.c')
-rw-r--r-- | src/scripting.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/scripting.c b/src/scripting.c index 3ae25152f..639fd1f62 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -1164,6 +1164,19 @@ void evalGenericCommand(client *c, int evalsha) { lua_pop(lua,1); /* Remove the error handler. */ } + /* If we are using single commands replication, emit EXEC if there + * was at least a write. */ + if (server.lua_replicate_commands) { + preventCommandPropagation(c); + if (server.lua_multi_emitted) { + robj *propargv[1]; + propargv[0] = createStringObject("EXEC",4); + alsoPropagate(server.execCommand,c->db->id,propargv,1, + PROPAGATE_AOF|PROPAGATE_REPL); + decrRefCount(propargv[0]); + } + } + /* EVALSHA should be propagated to Slave and AOF file as full EVAL, unless * we are sure that the script was already in the context of all the * attached slaves *and* the current AOF file if enabled. @@ -1186,22 +1199,10 @@ void evalGenericCommand(client *c, int evalsha) { rewriteClientCommandArgument(c,0, resetRefCount(createStringObject("EVAL",4))); rewriteClientCommandArgument(c,1,script); + printf("forceCommandPropagation\n"); forceCommandPropagation(c,PROPAGATE_REPL|PROPAGATE_AOF); } } - - /* If we are using single commands replication, emit EXEC if there - * was at least a write. */ - if (server.lua_replicate_commands) { - preventCommandPropagation(c); - if (server.lua_multi_emitted) { - robj *propargv[1]; - propargv[0] = createStringObject("EXEC",4); - alsoPropagate(server.execCommand,c->db->id,propargv,1, - PROPAGATE_AOF|PROPAGATE_REPL); - decrRefCount(propargv[0]); - } - } } void evalCommand(client *c) { |