Skip to content

[2.10] [MOD-15685] Fix crash when a legacy index spec is restored on a running server - #11609

Merged
redisearch-backport-pull-request[bot] merged 1 commit into
2.10from
backport-agent/pr-10872-to-2.10
Sep 29, 2026
Merged

redisearch-backport-pull-request[bot] merged 1 commit into
2.10from
backport-agent/pr-10872-to-2.10

Conversation

@redisearch-backport-pull-request

@redisearch-backport-pull-request redisearch-backport-pull-request Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #10872 to 2.10.

Original PR

Cherry-pick result

  • Resolved 2 conflict(s) — see Conflict Log below.

Conflict Log

src/spec.c

  • Conflict: The guard insertion overlaps release-branch loader context: 2.10 reads into name, while master reads into legacyName after a disk-storage assertion.
  • Why it conflicted: The 2.10 loader predates the master naming and disk-storage changes; it still dereferences the same legacy dictionaries, which are released after loading.
  • Resolution: Added the original NULL guard before the first payload read, retained the existing name variable, and omitted the master-only disk assertion.
  • Rationale: Rejects RESTORE when either legacy dictionary is absent while preserving the existing 2.10 RDB upgrade path and encoding range.

tests/pytests/test_legacy_module_types.py

  • Conflict: Modify/delete conflict: the original PR appends a regression test to a file absent on 2.10.
  • Why it conflicted: The target does not contain the earlier legacy-module persistence test file and its payload-construction helpers.
  • Resolution: Created the file with the PR regression test and the imports, constants, and helpers it needs. Excluded the earlier persistence round-trip test, helper-validation test, and unused legacy-body helper; removed comments referring to those omitted tests.
  • Rationale: Preserves the PR assertions that legacy spec RESTORE fails for versions 2, 9, and 16 without creating keys or killing the server, without importing unrelated persistence coverage. Static diff checks passed; builds and tests were not run as instructed and CI must validate the backport.

Release notes

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

🤖 Generated by the auto-backport workflow.

…ng server (#10872)

[MOD-15685] Refuse a legacy index spec RESTORE outside an RDB load

A legacy index spec can only be upgraded while a load is in progress: both the
UPGRADE_INDEX rules and the registry of legacy specs are built for the duration of
a load and released at the end of it. IndexSpec_LegacyRdbLoad then looks both up
unconditionally, so restoring a legacy ft_index0 payload on a running server
reached dictFetchValue on a NULL dict and segfaulted. Any client holding RESTORE
could do it.

Refuse when either global is absent. The caller sees a load failure, which for
RESTORE surfaces as a command error rather than a dead server. The check sits
before anything is read, so a crafted payload needs no valid body to be rejected.

Verified by removing the guard again: the server dies with the test reporting
connection refused, so the test fails when the bug is present rather than passing
for the wrong reason.

This is MOD-15685 finding #71; #29 was fixed in #10817.

Co-authored-by: Claude Opus 5 <[email protected]>
(cherry picked from commit 1d4c089)
@redisearch-backport-pull-request
redisearch-backport-pull-request Bot added this pull request to the merge queue Sep 29, 2026
@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.51%. Comparing base (e5e1e0d) to head (40f44a0).

Additional details and impacted files
@@            Coverage Diff             @@
##             2.10   #11609      +/-   ##
==========================================
- Coverage   89.56%   89.51%   -0.05%     
==========================================
  Files         212      212              
  Lines       36709    36712       +3     
==========================================
- Hits        32877    32863      -14     
- Misses       3832     3849      +17     
Flag Coverage Δ
flow 84.08% <100.00%> (-0.22%) ⬇️
unit 43.00% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@sonarqubecloud

Copy link
Copy Markdown

Merged via the queue into 2.10 with commit a49c54f Sep 29, 2026
26 checks passed
@redisearch-backport-pull-request
redisearch-backport-pull-request Bot deleted the backport-agent/pr-10872-to-2.10 branch September 29, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport This PR was automatically backported by an agent auto-backport-conflicts There were conflicts in this automatic backport size:S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant