summaryrefslogtreecommitdiff
path: root/src/module.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-11-23 13:05:00 +0100
committerantirez <antirez@gmail.com>2017-11-23 13:05:37 +0100
commitd21f4769b82f07d2b06be20e80720e71c674f3bd (patch)
treef2136b833786bd43b04d207a759ea5347e94d5e3 /src/module.c
parent57bd8feb8d81064cd53a7f124e7509134fb7459b (diff)
downloadredis-modules-replication.tar.gz
Modules: fix for scripting replication of modules commands.modules-replication
See issue #4466 / #4467.
Diffstat (limited to 'src/module.c')
-rw-r--r--src/module.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c
index afeb6e2cf..dbcc29e7a 100644
--- a/src/module.c
+++ b/src/module.c
@@ -442,9 +442,7 @@ void moduleFreeContext(RedisModuleCtx *ctx) {
void moduleHandlePropagationAfterCommandCallback(RedisModuleCtx *ctx) {
client *c = ctx->client;
- /* We don't want any automatic propagation here since in modules we handle
- * replication / AOF propagation in explicit ways. */
- preventCommandPropagation(c);
+ if (c->flags & CLIENT_LUA) return;
/* Handle the replication of the final EXEC, since whatever a command
* emits is always wrappered around MULTI/EXEC. */
@@ -1164,6 +1162,7 @@ int RM_ReplyWithDouble(RedisModuleCtx *ctx, double d) {
* in the context of a command execution. EXEC will be handled by the
* RedisModuleCommandDispatcher() function. */
void moduleReplicateMultiIfNeeded(RedisModuleCtx *ctx) {
+ if (ctx->client->flags & CLIENT_LUA) return;
/* If we already emitted MULTI return ASAP. */
if (ctx->flags & REDISMODULE_CTX_MULTI_EMITTED) return;
/* If this is a thread safe context, we do not want to wrap commands
@@ -1216,6 +1215,7 @@ int RM_Replicate(RedisModuleCtx *ctx, const char *cmdname, const char *fmt, ...)
/* Release the argv. */
for (j = 0; j < argc; j++) decrRefCount(argv[j]);
zfree(argv);
+ server.dirty++;
return REDISMODULE_OK;
}
@@ -1234,6 +1234,7 @@ int RM_ReplicateVerbatim(RedisModuleCtx *ctx) {
alsoPropagate(ctx->client->cmd,ctx->client->db->id,
ctx->client->argv,ctx->client->argc,
PROPAGATE_AOF|PROPAGATE_REPL);
+ server.dirty++;
return REDISMODULE_OK;
}