EVALRun a Lua script server-side; routed to KEYS[1]'s shard when numkeys >= 1.
| 構文 | EVAL script numkeys [key [key ...]] [arg [arg ...]] |
| グループ | script |
| 引数の数 | -3 |
| 導入バージョン | 1.0.0 |
| フラグ | write |
| 計算量 | O(compile + the script's own work). The whole script is one atomic unit on KEYS[1]'s shard and blocks that shard for its duration. The runaway guard is an INSTRUCTION budget (lua time_limit_ms x 40000 instructions), not a wall clock |
| Redis 互換性 | differs: there is no -BUSY state and no SCRIPT KILL — an over-budget script is aborted in place and answered with an ordinary error; nested EVAL is rejected, a redis.call touching another shard's key returns CROSSSLOT, and EVAL auto-caches its source by SHA1 so EVALSHA works without SCRIPT LOAD. Scripts replicate by SOURCE, not by effects: a script calling SPOP draws its own random members on a replica or an AOF replay — keep nondeterministic verbs out of scripts you replicate (plain SPOP outside EVAL propagates its effect and is safe) |