Repository navigation
[MOD-15685] Fix crash when a legacy index spec is restored after a failed replication sync - #11619
Conversation
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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11619 +/- ##
==========================================
- Coverage 84.23% 83.53% -0.71%
==========================================
Files 640 665 +25
Lines 85436 86529 +1093
Branches 39264 40356 +1092
==========================================
+ Hits 71969 72280 +311
- Misses 13101 13875 +774
- Partials 366 374 +8
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:
|
|
🤖 Auto-backport summary
(PR #11619, Workflow run · Retry unfinished targets with |
Resolve the conflict in test_legacy_module_types.py by keeping both the legacy-loader tests from this branch and the failed-sync RESTORE test from master (#11619). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…field-path-load Pick up master (via #11605's branch) and resolve the conflict in test_legacy_module_types.py by keeping both this branch's test and master's failed-sync RESTORE test (#11619). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
/backport 8.2 |
|
🤖 Auto-backport summary
(PR #11619, Workflow run · Retry unfinished targets with |
…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)
…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)
…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)
…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)
…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)



Describe 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