On Thu, Mar 27, 2014 at 10:15 AM, Marc Gravell <
marc.g...@gmail.com> wrote:
> But to be explicit - I agree with you that there is a bug here, as you can
> achieve inconsistent state:
Hello Marc,
this is definitely not desirable, but there are solutions (having the
effect of slowing down EVAL), I'm still not sure how much the slowdown
will be.
Basically luaRedisGenericCommand() in script.c handles the calling of
Redis commands from Lua.
This function already does a number of checks, creates the argument
vector, and so forth.
It will do an additional check: will match the keys called by Lua with
the keys declared by EVAL, and if they don't match, an error will be
returned.
To do this when Lua is called a dictionary will be populated with the
key names, and for every called function we have to use our API to
extract keys from command names.
I think that the slowdown will be around 5-10%. This feature probably
is worth to be exposed to normal instances, on demand, via some
eval-strict-mode parameter. I can see how in certain environments it
could be desirable to force to only use keys declared in scripts.
Salvatore
--
Salvatore 'antirez' Sanfilippo
open source developer - GoPivotal
http://invece.org
To "attack a straw man" is to create the illusion of having refuted a
proposition by replacing it with a superficially similar yet
unequivalent proposition (the "straw man"), and to refute it
-- Wikipedia (Straw man page)