redis_proxy: fix SCAN command to comply with Redis specification (#42…#44070
Open
DhruvaD1 wants to merge 1 commit intoenvoyproxy:mainfrom
Open
redis_proxy: fix SCAN command to comply with Redis specification (#42…#44070DhruvaD1 wants to merge 1 commit intoenvoyproxy:mainfrom
DhruvaD1 wants to merge 1 commit intoenvoyproxy:mainfrom
Conversation
…oyproxy#42889) Signed-off-by: dhruvad <dhruvad.201@gmail.com>
|
Hi @DhruvaD1, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
Member
|
gently ping @nezdolik as the redis code owner :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…889)
Commit Message: redis_proxy: fix SCAN command to comply with Redis specification
Additional Description:
Previously, the Redis proxy SCAN command fanned out to all shards simultaneously and returned concatenated cursor/key pairs (one per shard), violating the Redis SCAN specification.
This fix routes SCAN to a single shard at a time using an encoded cursor format. When a shard finishes iteration, the proxy automatically goes to the next shard. The client receives a spec-compliant response at every step and only sees cursor "0" when all shards have been scanned.
The previous attempt at this fix (#43114) was closed without merging.
Risk Level: Medium
Testing:
Unit tests passing (213/213). 8 new tests for the single-shard path these cover cursor encoding, shard routing, shard advancement, last-shard completion, invalid cursor format, out-of-bounds shard index, upstream failure, and cancel. Verified the bug is real by running SCAN against a live 3-node Redis cluster through stock Envoy v1.37.1.
Docs Changes: None
Release Notes: Fixed Redis proxy SCAN to return spec-compliant responses in sharded clusters.
[Optional Fixes #Issue] #42889