[8.6] Fix edge case in clusterset - [MOD-13562]#8090
[8.6] Fix edge case in clusterset - [MOD-13562]#8090redisearch-backport-pull-request[bot] merged 1 commit into8.6from
Conversation
* collect all shards (including replicas and no slots) and filter only at the end * Add API description * Align usage * add a test * avoid string arg consuming of standalone flag params * fix unit tests * add another test * align and add flow tests * add another case (cherry picked from commit a2279bd)
| } | ||
|
|
||
| // Append new slot range | ||
| array_ensure_append_1(existing_shard->slotRanges, sh->slotRanges[0]); |
There was a problem hiding this comment.
MASTER flag not propagated on shard re-appearance
Medium Severity
When a shard ID re-appears in the clusterset command, the isMaster flag from the re-appearing entry is not propagated to the existing shard stored in the dictionary. The code appends slot ranges from sh to existing_shard but then frees sh without copying sh->isMaster to existing_shard->isMaster. If MASTER is specified only on a re-appearance entry (not the first appearance), the shard will have isMaster=false and be excluded from the topology during the filtering at lines 299-302.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.6 #8090 +/- ##
=======================================
Coverage 84.01% 84.02%
=======================================
Files 365 365
Lines 55097 55098 +1
Branches 14296 14296
=======================================
+ Hits 46291 46295 +4
+ Misses 8645 8642 -3
Partials 161 161
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Backport of #8068 to
8.6.Note
Backports improvements to cluster topology parsing and handling for
SEARCH.CLUSTERSET.MASTERthat haveSLOTRANGEs; trackisMasterand skip replicas/empty shardsUNIXADDRsafely (don’t consumeMASTER/SHARDas values; detect duplicates) and relax re-appearance rules for shards (SLOTRANGE≤ 1, append if ordered)MYIDto not appear in the final topology (e.g., local shard is replica or has no slots); only error ifMYIDnever listed; computemy_shard_idxaccordinglySetClusterCommand, if local shard is excluded (my_shard_idx == UINT32_MAX), set an empty local slots array when callingMR_UpdateTopologyWritten by Cursor Bugbot for commit c349031. This will update automatically on new commits. Configure here.