Repository navigation
fix(autoindex): re-walk the catalog read-back while it falls short of the projection (#1212) - #1216
Merged
Merged
Conversation
… the projection (#1212) The live failure (standing xerj-search resume, 2026-10-06): finalize's run_id-scoped read-back walk read 9 full 1,000-hit pages, then an EMPTY page with timed_out absent — 9,000 of 58,568 documents, no flag, no error. validate_observed's exact-equality check then aborted the run after a 26-minute finalize, and the same walk on an idle node minutes later read all 59 pages clean at ~1.5 s/page. A terms aggregation on the same field counted 58,568; a plain term query moments after the empty page returned 0 hits with an "unknown_value" hint. So the engine (#1212, engine half still open) intermittently truncates sorted scans and term queries under load while aggregations see the full set. Neither existing defense can see this shape: - the Es client's bounded 5xx retry only re-sends failed requests — this answer was HTTP 200; - #1213's page-level deadline check (branch fix/autoindex-partial-page- truncation) retried pages that admit timed_out=true — this answer carried no flag; - page answers report total {value: 10000, relation: "gte"} under the track_total_hits cap, so a walker cannot use total to validate a short page either. The only signal that distinguishes a starved walk from a complete one is observed-count-versus-expected, which the barrier already computes: the sealed projection's document count. Change: catalog_generation_complete() walks once and, while the observation is short of the projection's document count and attempts remain, refreshes the catalog and walks again — bounded at 3 attempts (READBACK_WALK_ATTEMPTS). One intermittent engine answer no longer costs the whole finalize. When every attempt falls short, the LAST observation is returned so validate_observed produces its loud, precise mismatch error over the final walk's counts, not a stale one. The #971 prior-run stray sweep (catalog_generation(prior_run_id)) is deliberately NOT re-walked: it is a subset check, so an unflagged truncated page can only under-report strays — a false pass is impossible, and a re-walk would only re-run the sweep's deletes. The retry loop is isolated as EsSyncBackend::rewalk_while_short over closures so its contract is pinnable without a node; four unit tests cover it: a complete first walk returns without refreshing, a short walk is refreshed and re-walked until complete, a walk short every time costs exactly the attempt budget and returns the last observation, and a transport error propagates without a retry (an error is not a short walk). Scoped run: cargo test -p xerj-autoindex --lib → 1290 passed, 0 failed. fmt + clippy -D warnings clean. Reference-code mandate: skipped — this change is confined to this repository's own client/runner logic (the read-back barrier in the autoindex executor); the engine-side defect is tracked on #1212. Files: - engine/crates/xerj-autoindex/src/sync_executor.rs: catalog_generation_complete, rewalk_while_short, READBACK_WALK_ATTEMPTS, publish_generation_catalog read-back call site, tests
This was referenced Oct 7, 2026
This was referenced Oct 7, 2026
Merged
neoneye
pushed a commit
to agent-memory-atlas-archive/xerj-org--xerj
that referenced
this pull request
Oct 10, 2026
Workspace version + Cargo.lock (17 member entries). Release window: xerj-org#1211, xerj-org#1213, xerj-org#1215, xerj-org#1216, xerj-org#1217, xerj-org#1218.
neoneye
pushed a commit
to agent-memory-atlas-archive/xerj-org--xerj
that referenced
this pull request
Oct 10, 2026
Six window entries: xerj-org#1211 (blog guest post), xerj-org#1217 (kNN exact-scan column ranking, its Unreleased entry carried verbatim under Performance), xerj-org#1213/xerj-org#1216 (the two xerj-org#1212 client legs: explicit page timeouts + observed-vs-projection re-walk), xerj-org#1215 (xerj-org#1214: corpus index refuses an unresumable run over a recorded build), xerj-org#1218 (the xerj-org#1212 engine half: capture-scoped version-map reads). Every xerj-org#1212 entry says the issue stays open — it closes only on a released, verified standing rebuild. xerj-org#1220 cited as the follow-up the xerj-org#1217 review surfaced.
neoneye
pushed a commit
to agent-memory-atlas-archive/xerj-org--xerj
that referenced
this pull request
Oct 10, 2026
…ntry The read-back re-walk entry cites xerj-org#1212, which stays open until the released engine fix is verified by a full standing rebuild; the notes gate correctly refused the entry without that said.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The finalize read-back barrier now re-walks the catalog while its observation falls short of the sealed projection, bounded at 3 attempts, instead of judging a starved walk with exact equality.
Why (#1212, second live shape)
The standing xerj-search resume (2026-10-06) died at the read-back barrier with:
The walk had read 9 full 1,000-hit pages, then an empty page with
timed_outabsent. No flag, HTTP 200, no error. Minutes later:termquery on the same field/value returned 0 hits (engineunknown_valuehint), whileSo the engine intermittently truncates sorted scans and term queries under load while aggregations see the full set (engine half tracked on #1212, which stays open).
Neither existing defense can see this shape:
timed_out=true— this page carried no flag;total {value: 10000, relation: "gte"}under the track_total_hits cap, sototalcannot validate a short page either.The only distinguishing signal is observed-count-versus-expected, which the barrier already has: the projection's document count.
Change
EsSyncBackend::catalog_generation_complete(run_id, expected)— walk once; while short ofexpectedwith attempts remaining,refreshthe catalog and walk again (READBACK_WALK_ATTEMPTS = 3).validate_observed's exact-equality error names the final walk's counts, not a stale one.rewalk_while_shortover closures; 4 new unit tests pin: complete-first-walk (no refresh), short-then-complete (one refresh, two walks), short-every-time (exactly the budget, last observation returned), transport error propagates without a retry.Tests
cargo test -p xerj-autoindex --lib→ 1290 passed, 0 failed (was 1286). fmt +clippy -D warningsclean.Reference-code mandate: skipped — confined to this repository's own client/runner logic (autoindex read-back barrier); the engine defect stays on #1212.