mirror of
https://github.com/fluencelabs/redis
synced 2025-06-16 18:51:20 +00:00
Nested MULTI/EXEC may replicate in different cases.
For example: 1. A module command called within a MULTI section. 2. A Lua script with replicate_commands() called within a MULTI section. 3. A module command called from a Lua script in the above context.
This commit is contained in:
@ -1164,6 +1164,8 @@ 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) {
|
||||
/* Skip this if client explicitly wrap the command with MULTI */
|
||||
if (ctx->client->flags & CLIENT_MULTI) 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
|
||||
|
Reference in New Issue
Block a user