kevy

EVAL

Run a Lua script server-side; routed to KEYS[1]'s shard when numkeys >= 1.

SyntaxEVAL script numkeys [key [key ...]] [arg [arg ...]]
Groupscript
Arity-3
Since1.0.0
Flagswrite
ComplexityO(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 compatibilitydiffers: 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)

← All commands