CLUSTERSCAN range bounded scanning across contiguous slots#3391
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #3391 +/- ##
============================================
- Coverage 76.75% 76.64% -0.12%
============================================
Files 162 162
Lines 80614 80637 +23
============================================
- Hits 61879 61801 -78
- Misses 18735 18836 +101
🚀 New features to boost your workflow:
|
c85e254 to
b282231
Compare
1133666 to
d25fcba
Compare
zuiderkwast
reviewed
Apr 7, 2026
a58bb52 to
fadbc7f
Compare
zuiderkwast
reviewed
Apr 8, 2026
zuiderkwast
reviewed
Apr 8, 2026
1697f24 to
405af6e
Compare
Contributor
Author
|
Thank you @zuiderkwast for the suggestions and review. I had not considered grouping the CLUSTERSCAN specific args separately. I updated the code so callers keep PTAL. |
zuiderkwast
reviewed
May 5, 2026
zuiderkwast
left a comment
Contributor
There was a problem hiding this comment.
Yeah, it's good. We can merge it after a small clean up.
zuiderkwast
approved these changes
May 5, 2026
Instead of scanning one slot at a time `CLUSTERSCAN` now scans the entire contiguous range of slots owned by the current node. Implementation details * Added `final_slot` parameter to `scanGenericCommand` replacing `cursor_prefix`/`finished_cursor_prefix` * Re-sharding safe as the hash slot is updated based on the local cursor position. Signed-off-by: nmvk <r@nmvk.com>
Refactor and rename Signed-off-by: nmvk <r@nmvk.com>
Signed-off-by: nmvk <r@nmvk.com>
Move it to data types. Signed-off-by: nmvk <r@nmvk.com>
Similar to `parseExtendedCommandArgumentsOrReply` to ensure the common arguments are parsed together. Signed-off-by: nmvk <r@nmvk.com>
zuiderkwast
reviewed
May 6, 2026
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Contributor
Author
|
Thank you @zuiderkwast 🎉 |
lucasyonge
pushed a commit
that referenced
this pull request
May 11, 2026
Instead of scanning one slot at a time `CLUSTERSCAN` now scans the
entire contiguous range of slots owned by the current node.
Implementation details
* Re-sharding safe as the hash slot is updated based on the local cursor
position.
* Fingerprint remains stable across the entire contiguous slot range
instead of being reset per slot.
* Parsing/validation of parameters for the SCAN commands is refactored
and moved to a separate function.
```
> CLUSTERSCAN 0
"0-{06S}-0" # start at slot 0
> CLUSTERSCAN 0-{06S}-0
"aBcDeF-{06S}-48" # scanning slot 0...
> CLUSTERSCAN aBcDeF-{06S}-48
"aBcDeF-{1Y7}-16" # slot 0 done, continues to slot 6 (same node hence FP is unchanged)
> CLUSTERSCAN aBcDeF-{1Y7}-16
"aBcDeF-{0or}-32" # slot 6 done, continues to slot 100 (same node hence FP is unchanged)
...
> CLUSTERSCAN aBcDeF-{...}-64
"0-{8YG}-0" # Current continuous slot boundary reached hence cross-node transition
```
Follow-up of #2934
---------
Signed-off-by: nmvk <r@nmvk.com>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
lucasyonge
pushed a commit
that referenced
this pull request
May 12, 2026
Instead of scanning one slot at a time `CLUSTERSCAN` now scans the
entire contiguous range of slots owned by the current node.
Implementation details
* Re-sharding safe as the hash slot is updated based on the local cursor
position.
* Fingerprint remains stable across the entire contiguous slot range
instead of being reset per slot.
* Parsing/validation of parameters for the SCAN commands is refactored
and moved to a separate function.
```
> CLUSTERSCAN 0
"0-{06S}-0" # start at slot 0
> CLUSTERSCAN 0-{06S}-0
"aBcDeF-{06S}-48" # scanning slot 0...
> CLUSTERSCAN aBcDeF-{06S}-48
"aBcDeF-{1Y7}-16" # slot 0 done, continues to slot 6 (same node hence FP is unchanged)
> CLUSTERSCAN aBcDeF-{1Y7}-16
"aBcDeF-{0or}-32" # slot 6 done, continues to slot 100 (same node hence FP is unchanged)
...
> CLUSTERSCAN aBcDeF-{...}-64
"0-{8YG}-0" # Current continuous slot boundary reached hence cross-node transition
```
Follow-up of #2934
---------
Signed-off-by: nmvk <r@nmvk.com>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
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.
Instead of scanning one slot at a time
CLUSTERSCANnow scans the entire contiguous range of slots owned by the current node.Implementation details
Follow-up of #2934