Repository navigation
Conversation
`reconcile_groups` derives the new group id from path ownership when the content id is unknown. A predecessor group that held two byte-identical paths gives both new desired groups that same owner, so the second `claimed.insert` returns false and the pass aborts with "group claimed twice" (xerj-org#3831). The files were identical on the first pass and diverged between the two passes, so no content id matches and every new group falls through to the path-owner branch. Keep the predecessor id for the first group, as before, and derive a new `axg1-...` id for later ones that would collide. The second pass writes both files instead of failing, and re-running on the result is a no-op. Test: `diverged_identical_pair_does_not_claim_one_group_twice` fails on the parent commit and passes with the change; full `xerj-autoindex` lib suite is 2123 passed, with `xc::tests::xerj_code_on_an_empty_ledger_names_catalog_prefixes` failing on the parent commit too.
|
Thanks for this contribution — we'd like to merge it. Before we can, we need a signed Contributor License Agreement from: @ege-arhan It is a one-time thing per contributor, not per pull request. Read CLA.md, then open a small pull request adding your GitHub username to Once it is merged, comment |
This branch has not been deployed
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 this changes, and why
Fixes #3831.
The second
autoindexpass aborts witherror: group claimed twicewhen two byte-identical files have diverged between passes.reconcile_groupspicks the new group id in this order: known content id, then path ownership, then a derived id. When the content changed, no content id matches, so the decision falls topath_owners. A predecessor group that held both identical copies owns both paths. Both new desired groups therefore get that one predecessorgroup_id, and the secondclaimed.insert(group_id)returnsfalse:The first group keeps the predecessor id; later groups that would collide now get a derived
axg1-…id instead of aborting the pass. Re-running on the result is a no-op, so the next pass sees two independent groups and stops there.Nothing else changes: content ids, digests, canonical path selection, and the existing "changed file can join surviving content group" path are untouched.
Evidence
New test
diverged_identical_pair_does_not_claim_one_group_twicebuilds one predecessor group with paths61and62, then reconciles two desired groups with different content ids and one path each.Parent commit
cc6aee8:With the change:
Full
xerj-autoindexlib suite with the change:The single failure is
xc::tests::xerj_code_on_an_empty_ledger_names_catalog_prefixes(assertion left == right failed: a non-empty ledger must not probe the catalog, left 3, right 2). It fails the same way on parent commitcc6aee8with my change stashed, so it is not from this diff.Checks
cargo fmt --all—cargo fmt -p xerj-autoindex -- --checkexits 0cargo build --release -j 8 -p xerj-autoindex->Finished \release` profile [optimized] target(s) in 2m 45s`cargo test -p xerj-autoindexpasses — 2122 passed, 1 pre-existing failure named abovedocs/CONTRIBUTION_REVIEW.md— recovery/stateful read: the change only widens group-id derivation, and the new test asserts the second pass over the result is idempotentNot run: ES-YAML suite (this change touches neither the query path nor ES compatibility, so the suite would not exercise it).
cargo clippy -D warningsfails incrates/xerj-common/src/packed_f32.rs:55onchunks_exact→as_chunkswith rustc 1.100.0 — that file is untouched by this diff and the lint fires on parent commit too.Provenance
cc6aee8and passes with the change;cargo test -p xerj-autoindex --lib2122 passed / 1 pre-existing failure;cargo fmt -p xerj-autoindex -- --checkexit 0;cargo build --release -j 8 -p xerj-autoindexfinished in 2m45s;xc::tests::xerj_code_on_an_empty_ledger_names_catalog_prefixesfails identically on the parent commit.xerj autoindexscript from the issue against a built release binary, so I have not watched the CLI print success on the second pass. The unit test asserts the samereconcile_groupscontract that the CLI path calls throughsync_executor::reconcile. If the CLI failure came from a different call site that reimplements group claiming, this patch would not fix it; the binary repro would show the error still present.