Repository navigation
[8.2] [MOD-15685] Fix crash when a legacy index spec is restored after a failed replication sync - #11638
Merged
redisearch-backport-pull-request[bot] merged 1 commit intoSep 30, 2026
Conversation
…iled replication sync (#11619) [MOD-15685] Refuse a legacy index spec RESTORE after a failed load The guard added in #10872 refused a legacy ft_index0 load when the legacy-spec registry or the UPGRADE_INDEX rules were NULL, taking that as "no load in progress". A failed load breaks that assumption: LOADING_FAILED clears the loading flag but frees neither global, and the rules are only ever freed by a successful load. On a server that has not completed a load since startup - for example a replica whose first full sync failed and was then promoted - a RESTORE of a truncated legacy payload got past the guard and crashed on the NULL spec name. Key the refusal on g_isLoading as well. The new test drives exactly that sequence against a fake master; it crashes the server without the fix. Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit b1b6903)
Merged
1 of 4 tasks
kei-nan
approved these changes
Sep 30, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.2 #11638 +/- ##
==========================================
- Coverage 89.11% 89.04% -0.08%
==========================================
Files 262 262
Lines 43228 43228
Branches 3851 3851
==========================================
- Hits 38523 38491 -32
- Misses 4656 4688 +32
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
redisearch-backport-pull-request
Bot
deleted the
backport-agent/pr-11619-to-8.2
branch
September 30, 2026 10:25
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.



Backport of #11619 to
8.2.Merge commit:
b1b6903a1cc5b314fc64329f1434ff8f09710fddDescribe the changes in the pull request
ft_index0RESTOREoutside an RDB load, but it infers "outside a load" from the legacy-spec registry and theUPGRADE_INDEXrules being NULL. A failed load (LOADING_FAILED) leaves both allocated. So on a server that hasn't completed a load since startup, for example a replica whose first full sync failed and was then promoted, a truncated legacy payload still gets past the guard and crashes the server.g_isLoading).RESTOREof a legacy index spec now returns an error after a failed load too, instead of crashing the server.Which additional issues this PR fixes
Main objects this PR modified
IndexSpec_LegacyRdbLoad: the refusal now also checks loading state.test_legacy_module_types.py: new test that fails a full sync against a fake master, promotes the replica and restores a truncated legacy spec. Without the fix it crashes the server.Mark if applicable
Release Notes
🤖 Generated with Claude Code