Improve CLUSTERSCAN error handling test with broader coverage#3674
Merged
Conversation
Rewrite the CLUSTERDOWN test to use a 3-node cluster and cover four distinct degraded-cluster scenarios: 1. Node down with full-coverage enabled -> CLUSTERDOWN on all slots 2. Node down with full-coverage disabled -> MOVED for unreachable slots, local slots handled normally 3. Slot unassigned with full-coverage enabled -> "Hash slot not served" for the unassigned slot, CLUSTERDOWN for others 4. Slot unassigned with full-coverage disabled -> "Hash slot not served" for the unassigned slot, MOVED for remote slots Signed-off-by: Binbin <binloveplay1314@qq.com>
Member
Author
|
@nmvk I noticed this test while working on other changes, would you be able to take a look and review it? |
enjoy-binbin
commented
May 12, 2026
| set slot0_owner -1 | ||
| foreach n {0 1} { | ||
| if {[catch {R $n clusterscan 0-{06S}-0 SLOT 0} res] == 0} { | ||
| set cursor_slot_0 [lindex $res 0] |
Member
Author
There was a problem hiding this comment.
This actually returns {0 {}} in the old code, so cursor_slot_0 is 0, and in the wait condition, we are actually checking R 0 clusterscan 0.
I'm wondering if we should return "cluster down" for this. See the other PR (#3675) for more info
127.0.0.1:30001> clusterscan 0
1) "0-{06S}-0"
2) (empty array)
127.0.0.1:30001> clusterscan 0-{06S}-0
(error) CLUSTERDOWN The cluster is down
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3674 +/- ##
============================================
- Coverage 76.71% 76.54% -0.18%
============================================
Files 162 162
Lines 80656 80654 -2
============================================
- Hits 61872 61733 -139
- Misses 18784 18921 +137 🚀 New features to boost your workflow:
|
nmvk
approved these changes
May 12, 2026
Contributor
nmvk
left a comment
There was a problem hiding this comment.
Thank you @enjoy-binbin for adding the test with broader coverage
madolson
approved these changes
May 12, 2026
Member
madolson
left a comment
There was a problem hiding this comment.
More tests are always good :)
lucasyonge
pushed a commit
that referenced
this pull request
May 14, 2026
Rewrite the CLUSTERDOWN test to use a 3-node cluster and cover four distinct degraded-cluster scenarios: 1. Node down with full-coverage enabled -> CLUSTERDOWN on all slots 2. Node down with full-coverage disabled -> MOVED for unreachable slots, local slots handled normally 3. Slot unassigned with full-coverage enabled -> "Hash slot not served" for the unassigned slot, CLUSTERDOWN for others 4. Slot unassigned with full-coverage disabled -> "Hash slot not served" for the unassigned slot, MOVED for remote slots Signed-off-by: Binbin <binloveplay1314@qq.com>
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.
Rewrite the CLUSTERDOWN test to use a 3-node cluster and cover four
distinct degraded-cluster scenarios:
slots, local slots handled normally
for the unassigned slot, CLUSTERDOWN for others
for the unassigned slot, MOVED for remote slots