Skip to content

[BUG] replica receive nested "multi" command #8049

@linyi-xq

Description

@linyi-xq

Describe the bug

A short description of the bug.

1:S 13 Nov 2020 06:18:06.183 # == CRITICAL == This replica is sending an error to its master: 'MULTI calls can not be nested' after processing the command 'multi'

To reproduce

1、in redismodule, register mydel command and sub callback
2、delete a key in mydel command (del keya) . and the del cmd need propagateto replica.
3、step 2 delete action will trigger step 1 sub callback. in sub callback, a propagate command is executed (del keyb).

master will generate coomand:

multi    //generate by del keya in custom module command
multi    //generate by del keyb in subscribe callback
del keyb
exec     //generate by del keyb in subscribe callback
del keya
exec     //generate by del keya in custom module command

Reason
when trigger sub callback ,a new RedisModuleContext will be generated. the "REDISMODULE_CTX_MULTI_EMITTED" in old ctx is lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions