Closed zuiderkwast closed 7 months ago
Adding a new alias for the word server
seems very risky. I can easily imagine that there are already lua scripts with the word server
in them. valkey
would seem safer.
@daniel-house Good point. If script uses a variable named server
, they will get an error like I got here:
127.0.0.1:6379> eval 'server = "hello" return server' 0
(error) ERR user_script:1: Attempt to modify a readonly table script: eaea3495a27b17adb01815dd404912e3f3623d10, on @user_script:1.
@valkey-io/core-team Shall we add a valkey
Lua object instead?
I don't think it's a problem actually. Users can only create local variables. It's already possible to create a local variable called redis:
127.0.0.1:6379> eval 'local redis redis = "qux" return redis' 0
"qux"
Yeah, you have to create local variables. Someone might already be creating a local server that would shadow the global variable, but that shouldn't break their script. It is a valid callout that some folks might need some soft refactoring if they were declaring a local server variable, which would shadow the global one. I don't see a concern.
(Assigning it to me, although someone else from AWS is working on it. I'll update assignment when they join the triage group)
Fixed by #213
We shall also keep
redis
for backward compatibility.