Open
Description
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.