According to Redis documentation, lua scripts execute atomically. I assumed that this also means that scipts run as transactions, that is, all write commands in a script either succeed or fail. However I noticed, that write command changes do persist, even if script later returned an error.
For example, after running the following from redis cli, the key "k" has value "1", even though the script itself returns an error about access to global variable:
eval "redis.call(\"set\",KEYS[1],1) return x>1" 1 "k"
Is this expected? I'm I missing something? I'm running version 2.8.12 on Windows.