Fixed issue with moved command for replicas#2059
Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
|
@PavelPashov hi, possibly my PR should fix this issue #1734, I'm not sure that I know the way to attach this issue to the PR). |
|
@DevandScorp Thanks for the PR, looks good overall. CI is currently failing due to the new tests. Can you take a look and push a fix? |
|
@PavelPashov hi, I made a fix, hopefully it will work. |
|
@PavelPashov hi, it seems to me that all tests have passed, is there anything else needed from my side? |
PavelPashov
left a comment
There was a problem hiding this comment.
Looks good, thank you for the contribution
❌ Security scan failedSecurity scan failed: Branch DevandScorp/fix/issue-with-moved-command-for-replicas does not exist in the remote repository 💡 Need to bypass this check? Comment |
https://github.com/DevandScorp/ioredis into DevandScorp/fix/issue-with-moved-command-for-replicas
❌ Security scan failedSecurity scan failed: Branch DevandScorp/fix/issue-with-moved-command-for-replicas does not exist in the remote repository 💡 Need to bypass this check? Comment |
This reverts commit a1c3e9d.
## [5.9.2](v5.9.1...v5.9.2) (2026-01-15) ### Bug Fixes * **cluster:** Cluster reconnect sharded subscribers ([#2060](#2060)) ([def9804](def9804)) * preserve replica slots on MOVED in pipelines ([#2059](#2059)) ([a1c3e9d](a1c3e9d)) ### Reverts * Revert "fix: preserve replica slots on MOVED in pipelines (#2059)" (#2062) ([517b932](517b932)), closes [#2059](#2059) [#2062](#2062)
|
🎉 This PR is included in version 5.9.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…dis#2059)" (redis#2062)" This reverts commit 517b932.
…ines (redis#2059)" (redis#2062)"" This reverts commit d8c21ae.
Hi, I was fighting with the issue
All keys in the pipeline should belong to the same slots allocation groupfor quite a lot of time.Obviously this validation message can appear when smth is happening on the cluster and ioredis need some time to recalculate slots mapping. But in my case the cluster remained stable, and this validation messages were randomly shown on different instances of the application.
My PR has fixed the issue for the following scenario:
scaleReads=all+enableAutoPipelining=trueMOVEDmessages.READONLYcommand can be executed after several get operations already made on the replica(just some race condition, which can easily happen when we haveenableOfflineQueueandlazyConnectfeatures enabled). In this case I receiveMOVED <slot-number> <master-node-host>response.MOVEDcommand is not crucial, but the way moved command is handled is. Currently ioredis is rewriting a slot map without checking what is happening in the slot. With read replicas slot map's value is ['master-node-host', ...]. After rewriting it with the master's node address only future validations will fail ongenerateMultiWithNodesbefore a slots map refresh.I hope this fix will help a lot of users to stop receiving issues on the same setup I've described.