Skip to content

[QUESTION] Why must all keys be explicitly provided for standalone deployments in LUA scripts? #10296

@manast

Description

@manast

It has recently come to my attention a text in both the new FUNCTION command as well as in the older EVAL (from https://redis.io/commands/eval) command that states this

The script should only access keys whose names are given as input arguments. Scripts should never access keys 
with programmatically-generated names or based on the contents of data structures stored in the database.

I am pretty sure this has been a recommendation before and not a "should never", specially in a standalone scenario or if using "hash tags" in a clustered environment (https://redis.io/topics/cluster-tutorial).

Now, we have been generating keys inside lua scripts for a decade in Bull (https://github.com/optimalbits/bull) and BullMQ(https://github.com/taskforcesh/bullmq) without any issues. Thousands of companies depends on these libraries to work reliable every day so this change in the text has worried me. I suspect this has to do with the most strict rules you are enforcing on the new FUNCTION since the documentation changes comes from this PR: redis/redis-doc#1725

So please, could you clarify this change in the requirements of EVAL and if this is going to break future deployments of Bull/BullMQ as new versions of Redis are released?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions