Skip to content

Fix edge case in clusterset - [MOD-13562]#8068

Merged
GuyAv46 merged 9 commits intomasterfrom
guyav-fix_clusterset
Jan 19, 2026
Merged

Fix edge case in clusterset - [MOD-13562]#8068
GuyAv46 merged 9 commits intomasterfrom
guyav-fix_clusterset

Conversation

@GuyAv46
Copy link
Collaborator

@GuyAv46 GuyAv46 commented Jan 18, 2026

Describe the changes in the pull request

Fix an edge case in the Enterprise topology helper CLUSTERSET.

We now collect all the parsed shards into the temporary dictionary, and filter those we don't care for when building the final topology struct

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Note

Improves Enterprise CLUSTERSET topology handling and robustness.

  • Collects all parsed shards, then builds topology with only MASTER shards that have SLOTRANGE; introduces RLShard.isMaster
  • Allows MYID to be absent from the final topology when the local node has no slots or is a replica; identifies this via stored MYID offset
  • Fixes UNIXADDR parsing to avoid consuming MASTER/SHARD tokens; enforces single UNIXADDR and consistent per-shard values
  • Relaxes slot-range merging to permit shard reappearance without new ranges; validates ordering only when a new range is provided
  • In SetClusterCommand, when my_shard_idx == UINT32_MAX, updates cluster with an empty local slots array instead of failing or setting local id
  • Updates error messages and adds cpp/py tests covering missing UNIXADDR, multiple UNIXADDR, and cases where the local shard is empty or a replica
  • Documents RedisEnterprise_ParseTopology return/my_shard_idx behavior in redise.h

Written by Cursor Bugbot for commit 28f4386. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.89%. Comparing base (83ef6c2) to head (28f4386).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8068      +/-   ##
==========================================
- Coverage   84.01%   83.89%   -0.13%     
==========================================
  Files         365      365              
  Lines       55097    55168      +71     
  Branches    14296    14296              
==========================================
- Hits        46292    46283       -9     
- Misses       8644     8724      +80     
  Partials      161      161              
Flag Coverage Δ
flow 84.69% <75.86%> (-0.19%) ⬇️
unit 50.75% <79.31%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GuyAv46 GuyAv46 added this pull request to the merge queue Jan 19, 2026
Merged via the queue into master with commit a2279bd Jan 19, 2026
50 checks passed
@GuyAv46 GuyAv46 deleted the guyav-fix_clusterset branch January 19, 2026 17:41
redisearch-backport-pull-request bot pushed a commit that referenced this pull request Jan 19, 2026
* 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)
@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.4:

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Jan 19, 2026
* 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)
@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 8.6:

github-merge-queue bot pushed a commit that referenced this pull request Jan 20, 2026
Fix edge case in clusterset - [MOD-13562] (#8068)

* 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)

Co-authored-by: GuyAv46 <[email protected]>
eyalrund pushed a commit that referenced this pull request Jan 22, 2026
* 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
LukeMathWalker pushed a commit that referenced this pull request Jan 26, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants