fix(redis_proxy): implement targeted SCAN support for sharded clusters#43114
Closed
SushanthMusham wants to merge 1 commit intoenvoyproxy:mainfrom
Closed
fix(redis_proxy): implement targeted SCAN support for sharded clusters#43114SushanthMusham wants to merge 1 commit intoenvoyproxy:mainfrom
SushanthMusham wants to merge 1 commit intoenvoyproxy:mainfrom
Conversation
|
Hi @SushanthMusham, 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. |
Signed-off-by: DORAEMONlovesMICHAN <mushamsushanth@gmail.com>
7bc9a44 to
d31fb39
Compare
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.
Commit Message:
fix(redis_proxy): implement targeted SCAN support for sharded clusters
Additional Description:
This PR fixes the behavior of
SCANcommands in sharded Redis clusters. Previously, the proxy did not correctly routeSCANcommands to specific shards, leading to potential cursor loss or incorrect iteration.The changes implement a targeted scan approach:
shard_index:cursorformat (e.g.,2:15).This ensures that clients can iterate through the entire sharded keyspace without "cursor amnesia."
Risk Level:
Low
Testing:
Manual verification was performed using
redis-cliand a local Redis backend:SCAN <invalid_shard>:0correctly returns a "shard index out of bounds" error, confirming the parsing logic.SCAN 0:0successfully routes to the backend and returns a valid response.Docs Changes:
N/A
Release Notes:
redis_proxy: added support for targeted SCAN commands in sharded clusters using
shard_index:cursorformat.Platform Specific Features:
N/A
Generative AI Usage:
I used AI assistance (Gemini) to help navigate the codebase, debug build issues, and draft the C++ logic for
command_splitter_impl.cc. I have manually reviewed and tested the code to ensure its correctness.