Skip to content

test: register cross-impl hardlink batch replay divergence - #7958

Closed
oferchen wants to merge 1 commit into
masterfrom
test/cross-impl-hardlink-batch-divergence
Closed

oferchen wants to merge 1 commit into
masterfrom
test/cross-impl-hardlink-batch-divergence

Conversation

@oferchen

Copy link
Copy Markdown
Owner

What

Registers the cross-implementation hardlink --read-batch -aH divergence as owned, expiring #[ignore]'d parity tests in tests/batch_replay_upstream_parity.rs, matching that file's existing known-divergence convention. This pins the verified gap and the desired behavior in-repo ahead of the fix (task #18).

The divergence (verified with the upstream 3.4.4 oracle)

A batch is a tee of the protocol-32 wire stream, and the rsync man page makes cross-version/impl replay a contract (any reader at protocol ≥ writer must replay it). oc claims protocol-32 wire-compat with 3.4.4, so cross-impl batch replay is a fidelity obligation. It is currently broken both directions:

  • upstream writes → oc reads: exit 0 but silent data loss — the sorted-first cluster member is dropped, the other is left unlinked.
  • oc writes → upstream reads: exit 23 — both cluster members missing.

Root cause: oc's --write-batch ships the cluster's single payload under the sorted-first member's NDX (the oc-self convention from #7928), while upstream ships under the sorted-last member — the FLAG_HLINK_LAST data-holder its generator transfers (upstream hlink.c:113-194 match_gnums(), hlink.c:490-565 finish_hard_link()) — and oc's batch replay decodes the follower's first_hlink_ndx with a different base.

Scope: a plain network -H transfer is unaffected (verified both directions against the upstream daemon — oc's live wire receiver follows the sender's chosen data-holder correctly). The gap is specific to the batch write + batch-replay flist-decode paths, not the shared network receiver.

Why #[ignore] (registered, owned, expiring)

The tests assert the correct upstream-matching end state (every cluster member present, all sharing one inode with the right nlink, control independent), so they are desired-behavior tests, not a silent waiver. They fail today because the bug is real; the batch-path fix (task #18) un-ignores them. The ignore reason names the divergence and the tracking task, matching the other known-divergence entries in this file.

The oc-self replay_hardlink_pair_parity case stays non-ignored and green.

Coverage

  • 2-member cluster (aaa_leader.txt + zzz_holder.txt), both directions.
  • 3-member cluster (a_first.txt + b_mid.txt + z_last.txt), both directions — a middle member so an off-by-one in the group index cannot pass by luck.

Test plan

  • cargo fmt --all -- --check, tools/ci/check_rustfmt_all.py, cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings — clean (the ignored tests compile).
  • cargo nextest list --test batch_replay_upstream_parity — the two new cases register as ignored; replay_hardlink_pair_parity stays active.

Add oracle-gated cross-implementation --read-batch -aH parity cases for a
2- and 3-member hardlink cluster, both directions (upstream-writes/oc-reads
and oc-writes/upstream-reads). They assert the correct upstream-matching end
state: every cluster member present, all sharing one inode with the right
nlink, and the unlinked control independent.

Both are #[ignore]'d as a registered, owned known divergence (task #18):
oc's --write-batch ships the cluster's single payload under the sorted-first
member's NDX (the oc-self convention from #7928), while upstream ships it
under the sorted-last member - the FLAG_HLINK_LAST data-holder its generator
transfers (hlink.c:113-194 match_gnums(), hlink.c:490-565 finish_hard_link()),
and oc's batch replay decodes the follower's first_hlink_ndx with a different
base. So oc reading an upstream batch silently drops the leader (exit 0) and
upstream reading an oc batch exits 23.

A plain network -H transfer is unaffected - oc's live wire receiver follows
the sender's chosen data-holder correctly - so the divergence is specific to
the batch write and batch-replay paths, not the shared receiver.

These tests un-ignore when the batch-path fix lands (task #18); until then
they keep the verified divergence visible without a silent waiver. The
oc-self replay_hardlink_pair_parity case stays non-ignored and green.
@oferchen

Copy link
Copy Markdown
Owner Author

Superseded by #7959, which fixes the cross-impl hardlink batch divergence (writer ships under the sorted-last data-holder; batch-replay receiver links an absent sorted-first leader) and lands these same cross-impl parity cases un-ignored and passing in both directions. Closing to avoid a redundant register-then-unignore + a test-file conflict with #7959.

@oferchen oferchen closed this Sep 24, 2026
auto-merge was automatically disabled September 24, 2026 15:36

Pull request was closed

@oferchen
oferchen deleted the test/cross-impl-hardlink-batch-divergence branch September 29, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant