Lua script selective replication fixes.

This commit is contained in:
antirez
2015-10-29 15:57:41 +01:00
parent a1d1ca1416
commit dfe7f79708
3 changed files with 32 additions and 20 deletions

View File

@ -385,11 +385,11 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
/* Run the command */
int call_flags = CMD_CALL_SLOWLOG | CMD_CALL_STATS;
if (server.lua_replicate_commands) {
call_flags |= CMD_CALL_PROPAGATE;
/* Don't propagate AOf / replication stream if a redis.set_repl()
* call changed the default replication policy. */
if (!(server.lua_repl & PROPAGATE_AOF)) preventCommandAOF(c);
if (!(server.lua_repl & PROPAGATE_REPL)) preventCommandReplication(c);
/* Set flags according to redis.set_repl() settings. */
if (server.lua_repl & PROPAGATE_AOF)
call_flags |= CMD_CALL_PROPAGATE_AOF;
if (server.lua_repl & PROPAGATE_REPL)
call_flags |= CMD_CALL_PROPAGATE_REPL;
}
call(c,call_flags);