redis / node-redis

Redis Node.js client
https://redis.js.org/
MIT License
16.95k stars 1.89k forks source link

Set FIRST_KEY_INDEX if a script accepts keys #2848

Closed poiuj closed 1 month ago

poiuj commented 1 month ago

Description

Setting FIRST_KEY_INDEX ensures we send the script to the right node, instead of sending to random node and repeating on getting MOVED repsonse. Relying on a random node send increases traffic and exceeds maxCommandRedirections configuration with non-zero probability.

Checklist

poiuj commented 1 month ago

Closed it by mistake. Opened a new one – https://github.com/redis/node-redis/pull/2858