Skip to content

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

Merged
kei-nan merged 1 commit into
8.6from
backport-agent/pr-10872-to-8.6
Sep 30, 2026
Merged

kei-nan merged 1 commit into
8.6from
backport-agent/pr-10872-to-8.6

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

Original PR

Cherry-pick result

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

Conflict Log

src/spec.c

  • Conflict: The incoming hunk includes the new null-dictionary guard next to a SearchDisk_IsEnabled assertion; the release branch has no such assertion at this location.
  • Why it conflicted: 8.6 retains the legacy loader without the disk-mode assertion present in the source commit context. Both legacy dictionaries and their load-time lifecycle are present on this branch.
  • Resolution: Inserted the original guard and explanatory comment immediately after the encoding-version check and before the first payload read. Omitted the disk-mode assertion from the conflicting context, preserving the release loader otherwise unchanged.
  • Rationale: Rejects legacy RESTORE payloads when either dictionary is absent while preserving genuine RDB upgrades. The guard is identical to the original commit; no disk-mode behavior is introduced. Static diff and commit-provenance checks passed; builds and tests were not run, as requested.

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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 29, 2026
@kei-nan
kei-nan added this pull request to the merge queue Sep 30, 2026
Merged via the queue into 8.6 with commit 5f74f58 Sep 30, 2026
39 checks passed
@kei-nan
kei-nan deleted the backport-agent/pr-10872-to-8.6 branch September 30, 2026 08:48
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.

2 participants