Skip to content

index: surface corrupt rune and match offsets - #1108

Merged
keegancsmith merged 1 commit into
mainfrom
k/observable-corrupt-match-offsets
Aug 12, 2026
Merged

index: surface corrupt rune and match offsets#1108
keegancsmith merged 1 commit into
mainfrom
k/observable-corrupt-match-offsets

Conversation

@keegancsmith

@keegancsmith keegancsmith commented Aug 5, 2026

Copy link
Copy Markdown
Member

Malformed rune mappings previously underflowed into huge offsets, while defensive bounds checks risked turning the same corruption into an invisible non-match. Propagate the first per-document corruption error through Search so callers can distinguish incomplete results from a valid zero-match response.

Note: zoekt already handles panics in search as a corrupt index, and we mark as part of the search statistics that we crashed a shard. This commit makes it so we are far more defensive.

This supersedes #1059 with a smaller current-main implementation and addresses the silent-zero concern in #1106 by ensuring corruption contributes a crashed-shard signal rather than a plain non-match.

Test Plan: I checked all benchmarks for regressions + got an agent to exercise this change on my local sourcecode corpus.

Malformed rune mappings previously underflowed into huge offsets, while
defensive bounds checks risked turning the same corruption into an
invisible non-match. Propagate the first per-document corruption error
through Search so callers can distinguish incomplete results from a
valid zero-match response.

Note: zoekt already handles panics in search as a corrupt index, and we
mark as part of the search statistics that we crashed a shard. This
commit makes it so we are far more defensive.
@keegancsmith
keegancsmith force-pushed the k/observable-corrupt-match-offsets branch from c0392a6 to 969d417 Compare August 7, 2026 09:35
@keegancsmith
keegancsmith marked this pull request as ready for review August 7, 2026 09:39
@keegancsmith
keegancsmith enabled auto-merge (squash) August 12, 2026 14:45
@keegancsmith
keegancsmith merged commit c6cd014 into main Aug 12, 2026
7 checks passed
@keegancsmith
keegancsmith deleted the k/observable-corrupt-match-offsets branch August 12, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants