search_text returns text from a file that was withdrawn from the index (its full-text row survives as an anchor of a superseded generation) #592
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#592
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
search_textcan return lines from a file that is no longer indexed. When a file leaves the index through a configuration change (an addedextra_ignoresentry in the reproduction), the reconcile withdraws its live contribution, but its full-text row stays as an anchor of the superseded generation, kept for rollback.search_textjoins the full-text table tofileswithout requiring a contribution in the live generation, so the withdrawn file's text is still found.Evidence
Found by lane K1 of the v0.42 train while testing "no stale answer after a configuration repair" (
config_session_e2e::repaired_configuration_applies_new_ignore_before_serving, no-daemon leg). After the repaired configuration with the new ignore was reconciled, read-only inspection of the index showed: the full-text row ofmarker.txtstill present; its only contribution in generation 1 (superseded); generation 2 active.search_textfor the marker returned the file.The daemon leg of the same test passes; the difference between the two legs is not explained yet.
Not checked: whether v0.41.53 behaves the same (the query has no live-contribution predicate there either, by reading), and whether other readers of
files(list_files,read_codeby path,index_coverage, file counts inproject_overview) have the same gap. A registry test (every_daemon_row_read_is_generation_gated) exists for row reads and did not catch this path.Acceptance
search_text, on both the daemon and the no-daemon path; the test above is green on both legs.filesis audited for the same predicate, and the registry that gates generation-aware reads covers the full-text path.