antirez/redis — Issue #316: Lua's redis.call() does not increment the dirty counter
Author: antirez
Created: 2012-01-26 21:27:54+00:00
State: open
Labels: critical bug, more design needed

redis.call() skips the usual way to call a Redis command, that is calling the call() function, and instead directly use cmd->proc() to execute the command. This is needed since we need to skip replication/AOF/... of the command, however the side effect is that the dirty counter is not incremented.

We need to either add code in scripting.c to call the command, or more simply make call() taking an additional flags argument that is used to control the behavior of the command, like:

* CALL_DIRTY -> increment dirty counter
* CALL_PROPAGATE -> make sure to propagate the command in AOF/replication
* CALL_FULL -> all the flags ORed, in this case it is just CALL_DIRTY|CALL_PROPAGATE
* CALL_NONE will be set to 0, and will just call the command without performing any additional option

However I want to think more about the issue so the final solution may be completely different ;)