Reference resolution is one non-resumable transaction, so one-shot queries after an upgrade can never converge #301
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.
Blocks
Reference
h-dv/code-index#301
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?
After a schema upgrade that invalidates code caches (m0070, m0071), a
code-index querywith no daemon running never finishes reconciling. Each call answerswarming_up, and then the server is killed.What lane H measured (I075, on a django copy upgraded from schema 69, killing
code-index indexevery 15 s):What v0.32.1 ships: disclosure only. A one-shot
warming_upcarriesreconcile_pending { converges_on_retry: false, … }and names the remedy: runcode-index indexonce, or start the daemon. This is honest, but hooks such as the blast-radius hook still get no answer until a user acts.Proposed fix: make resolution resumable. Commit per batch or per file group, with a generation-safe cursor, so each short-lived process makes durable progress. This must keep the generation-gating invariants (
generation_build,generation_isolation) and the reader-epoch guarantees. A partially resolved generation must never be visible as complete.🤖 Generated with Claude Code
Still current as of
0bcdac1(checked by Phase 1 lane R on 2026-09-26): resolution is one transaction inapply_resolution_observed, so a one-shotcode-index queryanswerswarming_upwithconverges_on_retry: false.Two options:
code-index indexto finish it, and says so in its reply. Retries then converge without a daemon.This is a prerequisite before any language flips to a package in Phase 3.
The nightly
cargo teston master (run 5643, master at0bcdac1) failed inquery_cli::the_cli_log_level_reaches_the_spawned_server. It hit this issue directly: the one-shotcode-index queryansweredwarming_up("the index is still reconciling and retrying this query will not finish it"), so the test never reached the premise it asserts. The same test passed in every PR run of this code and in a local full run, so it is timing-dependent: it fails when the runner is loaded, and the nightly runs heavier jobs alongside it.Until this issue is fixed, any test that runs a one-shot query right after indexing can flake like this. Fixing this issue removes the flake class; a separate test-side workaround would only hide it.
Additional local reproduction of the existing one-shot log-level test's startup premise failure (the test comments already name this issue and earlier loaded-runner occurrences). During PR#439 validation, the full default-profile CLI nextest run completed446 cases:445 passed, and
query_cli::the_cli_log_level_reaches_the_spawned_serverfailed after10.329s because search_symbols returned warming_up/reconcile_pending for its explicit temporary --db. The latin1 warning had been emitted, so logging had begun; the committed queue was not observed before the existing one-shot deadline. This test and its query path are unchanged by PR439 (the source edits are plugin CLI mutation locking/notice).An isolated single-thread invocation of the same fixture, with unchanged source and deadlines, passed in17.390s for its two queries. Load sensitivity is consistent with the fixture's documented history; this does not establish the precise startup bottleneck. The original failure remains reported in the PR validation. No retry policy, runtime deadline, assertion or CI gate was weakened. Normal CI qualification of the corrected PR head remains required.
Current-source audit on v0.41.45 confirms this is implemented in crates/indexer/src/resolve_resume.rs: generation/content identity-fenced durable batches commit references and aggregates together; pending work remains visible until completion. All 14 resolve_resume unit tests passed freshly, including cancellation/kill/reopen convergence, snapshot changes and retained/pending generation isolation. The actual no_daemon_retries_resume_resolution_to_the_atomic_projection MCP test also passed: it requires more than one process and an observed durable queue, then checks exact equality with the uninterrupted projection and consistent ref counts after every committed batch. Existing v0.41.45 Linux/native-Windows qualification and release are green. This issue is ready to close as delivered, without another resolver implementation.