Skip to content

[8.4] Fixed an edge case where a shard that hasn't yet received cluster topology could reject internal queries with 'Query requires unavailable slots' during the first moments after server startup - [MOD-13828]#8394

Merged
redisearch-backport-pull-request[bot] merged 1 commit into8.4from
backport-8388-to-8.4
Feb 16, 2026

Conversation

@redisearch-backport-pull-request
Copy link
Copy Markdown
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request Bot commented Feb 16, 2026

Description

Backport of #8388 to 8.4.

Describe the changes in the pull request

Fix an edge case where some shard doesn't know the topology yet, but has to reply to some internal query from another shard. We prefer the shard to accept the request rather than fail with "Query requires unavailable slots". The uninitialized shard cannot be a coordinator until it knows the topology, and this change doesn't affect that.

Main objects this PR modified

  1. slots tracker

Mark if applicable

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

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

If a release note is required (bug fix / new feature / enhancement), describe the user impact of this PR in the title.

  • OSS users - the issue could happen in the first second of the server spawn
  • RE users - should not affect production yet

Note

Medium Risk
Changes default slot-availability semantics at startup, which can affect whether queries are accepted/rejected before topology is received; test updates reduce regression risk but behavior change impacts cluster edge cases.

Overview
Prevents startup-time internal queries from being rejected due to an uninitialized cluster topology by changing SlotsTracker::new() to start with the full slot range (0..=16383) as local instead of an empty set.

Because new() is no longer const, the FFI thread_local! initialization drops the const {} wrapper, and unit tests are updated to explicitly simulate the “no local slots yet” import scenario via set_local_slots(&[]) and to adjust version expectations accordingly.

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

…ology could reject internal queries with 'Query requires unavailable slots' during the first moments after server startup - [MOD-13828] (#8388)

* initialize SlotsTracker with all slots

* fix default implementation

(cherry picked from commit 7365bbd)
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@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.

local: SlotSet::from_ranges(&[SlotRange {
start: 0,
end: 16383,
}]),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggest a concise release note for user impact

Low Severity

Per the project rule, here is a suggested release note: "Fixed an edge case where a shard that hasn't received cluster topology yet could reject internal queries with 'Query requires unavailable slots' during the first moments after server startup." This covers the user-facing impact concisely; OSS users could encounter it in the first second after spawn, while RE users are unlikely to be affected in production.

Fix in Cursor Fix in Web

Triggered by project rule: Please assist in writing a GitHub release note for this PR, which is concise and focused on the user impact.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.45%. Comparing base (a5c6888) to head (fa11607).
⚠️ Report is 3 commits behind head on 8.4.

Files with missing lines Patch % Lines
...c/redisearch_rs/slots_tracker/src/slots_tracker.rs 85.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.4    #8394      +/-   ##
==========================================
- Coverage   85.46%   85.45%   -0.01%     
==========================================
  Files         335      335              
  Lines       53010    53027      +17     
  Branches    11000    11017      +17     
==========================================
+ Hits        45303    45314      +11     
- Misses       7564     7570       +6     
  Partials      143      143              
Flag Coverage Δ
flow 84.39% <ø> (-0.07%) ⬇️
unit 51.20% <85.00%> (+<0.01%) ⬆️

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.

@redisearch-backport-pull-request redisearch-backport-pull-request Bot added this pull request to the merge queue Feb 16, 2026
Merged via the queue into 8.4 with commit dca18a5 Feb 16, 2026
41 checks passed
@redisearch-backport-pull-request redisearch-backport-pull-request Bot deleted the backport-8388-to-8.4 branch February 16, 2026 17:31
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.

1 participant