Skip to content

Inconsistency for FIRST_KEY_INDEX for scripts in cluster mode #2521

Open
@dtikhonov-iex

Description

@dtikhonov-iex

Description

When using scripts in cluster mode, RedisCluster.extractFirstKey() is called with redisArgs the same as args. In other words, working off the example in documentation, when calling set('key', 1), redisArgs is set to ["SET", "key", "1"]; when calling add('key', 1), it's set to ["key", "1"].

Instead of setting FIRST_KEY_INDEX to the usual value of 1, for scripts, it should be set to 0 to get the correct key value.

This should be documented because it's not obvious. I happened to look at the packet capture and noticed this behavior. Because redirection works well, this inefficiency may go unnoticed by users.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions