Repository navigation
fix(corpus): retire stale index generations; never read a failed listing as empty - #1156
Merged
Merged
Conversation
…ing as empty Issue #1136, both halves of the leak, measured on the corpus-hub nodes: 1. LEGACY RUNS NEVER RETIRED ANYTHING. A corpus whose state file names no build (legacy mode, or a lost state file beside live indices) re-indexed under the bare xc-<corpus> namespace and left every stamped generation live forever. Measured: tldr-pages carried an unstamped 38,554-doc generation beside b1790965276-* (3,111) and b1791124662-* (4,706); kafka-protocol ~120 indices across three generations; unicode-cldr 2.18M docs. Because the ledger names no build, those stamped generations are unreachable BY CONSTRUCTION while xerj code queries the namespace — a top-5 was measured mixing current-mirror and dead-clone hits, failing 3 of 5 grade resolutions. Now: after a successful legacy run, every live xc-<name>-b<stamp>-* index is retired by exact name plus its catalog scope (one per generation, BTreeSet-deduped). The run's own unstamped output is kept. 2. A LISTING THE NODE NEVER ANSWERED READ AS 'NOTHING TO RETIRE'. corpus_indices swallowed list_indices errors into an empty Vec; the build arm then verified its replacement and retired an empty set in silence. Now corpus_indices returns (indices, listed_ok); the build arm says loudly that nothing will be retired, the post-failure cleanup says it kept rather than deleted blind, and the legacy arm skips its retirement with a message instead of a shrug. Visibility (#1136 knob 3): every verified --fresh swap ends with an epilogue that re-lists the namespace and NAMES whatever sits outside the prefix readers are pinned to (first 5 + count) — a half-failed retire is now on sight instead of a poison the next G7-grade query measures. And xerj code prints a stderr notice when a corpus has no verified build recorded, since the query then widens to the whole namespace (stdout is the parsed hit list, so the notice goes to stderr). Deliberate deviation from the issue's fix direction: index_prefix=null is warned-at, not refused. Seven corpora run in legacy state today and their only index IS the bare namespace; refusing would break seven working corpora to close a leak the retirement fix already drains. Tests (FakeNode harness, xc::tests): a legacy run retires stamped generations and keeps its own index, with exactly one catalog delete per generation; a never-answered listing retires nothing and deletes nothing blind; a refused delete leaves the old generation live under the new epilogue. 47/47 xc tests pass; xerj-common green; fmt + clippy clean. The ES wire path is untouched — the PR's conformance run is the gate. Files: - crates/xerj-autoindex/src/xc.rs (corpus_indices, stamped_prefix, retire_stamped, report_leftovers, corpus_index_flow build/legacy arms) - crates/xerj-common/src/xccode/mod.rs (legacy widening notice)
This was referenced Oct 5, 2026
Ravandevil25
pushed a commit
to Ravandevil25/xerj
that referenced
this pull request
Oct 6, 2026
- engine 1.0.0-rc.82 -> 1.0.0-rc.83 (Cargo.toml + cargo update -w, 17 lock entries) - landing: data-latest-tag + all 91 footer brand spans -> RC.83 (the xerj-org#1155 guard now enforces this at cut) - CHANGELOG: rc.83 section — xerj-org#1155 (version-roll guard + xxhash 0.8.19), xerj-org#1153 (xerj-org#1145/xerj-org#1148), xerj-org#1156 (xerj-org#1136), xerj-org#1154, xerj-org#1159 (EPUB), xerj-org#1160 (redundant-overlap section), xerj-org#1161 via xerj-org#1162 (notebooks + data-file naming) - ROADMAP: cut-roll — shortlist re-verified live: 8 open (xerj-org#1091 xerj-org#1092 xerj-org#1094 xerj-org#1100 xerj-org#1146 xerj-org#1147 xerj-org#1158 xerj-org#1122); xerj-org#1136/xerj-org#1145/xerj-org#1148 closed in-window, de-linked here and moved to CHANGELOG; rc.83 paragraph in the GA window record
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.
Closes #1136.
Both halves of the leak, measured on the corpus-hub nodes:
xc-<corpus>namespace and left every stamped generation live forever (tldr-pages: an unstamped 38,554-doc generation beside two stamped ones; kafka-protocol: ~120 indices; unicode-cldr: 2.18M docs). Since the ledger names no build, those generations are unreachable by construction whilexerj codequeries the namespace — a measured top-5 mixed current-mirror and dead-clone hits.corpus_indicesswallowedlist_indiceserrors into an emptyVec; the build arm verified its replacement and retired an empty set in silence.Changes (
xerj corpus index/xerj code):xc-<name>-b<stamp>-*index by exact name plus one catalog-scope delete per generation; its own unstamped output is kept.corpus_indicesreturns(indices, listed_ok); every arm says loudly when the node never answered a listing and retires nothing.--freshswap ends with an epilogue that re-lists the namespace and names whatever sits outside the prefix readers are pinned to (the issue's visibility knob).xerj codeprints a stderr notice when a corpus has no verified build recorded and the query widens to the whole namespace.One deliberate deviation from the issue's fix direction:
index_prefix=nullis warned-at, not refused — seven corpora run in legacy state today and their only index is the bare namespace; refusing would break seven working corpora to close a leak the retirement fix already drains.Tests: three new FakeNode cases (legacy retirement + per-generation catalog deletes, never-answered-listing deletes nothing blind, refused delete named by the epilogue); 47/47
xctests, xerj-common green, fmt + clippy clean. The ES wire path is untouched — this PR's conformance run is the gate.