Skip to content

fix: honour --parallel-delta-scan on remote-shell pushes - #8263

Merged
oferchen merged 4 commits into
masterfrom
feat/pds-gates
Oct 29, 2026
Merged

oferchen merged 4 commits into
masterfrom
feat/pds-gates

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • --parallel-delta-scan was silently ignored on remote-shell (ssh/rsh) pushes. The flag never goes on the wire, so each transport has to copy it onto its in-process sender's config. The daemon and embedded-ssh paths did that themselves; the external remote-shell path, which builds its sender config through apply_common_server_flags, never did. The flag now lives in apply_common_server_flags, which all three transports call, and the two per-path copies are removed.
  • matching::DeltaGenerator::generate_chunked is deleted (task Add NegotiatedStream array copy coverage #429). It was not a second engine: it wrapped generate_chunked_counted, the live parallel scan behind --parallel-delta-scan, and dropped the scan counters. Its only callers were tests, one bench and one example; they now call generate_chunked_counted. The rustdoc and three design docs that named it are updated.
  • Upstream 3.5.1 reconstructs byte-identically from an oc sender using --parallel-delta-scan, over both a daemon and a remote shell (task Add public API coverage for negotiation prologue sniffer #207, evidence below).

Evidence: upstream 3.5.1 as the receiver (task #207)

Fixture: a 96 MiB random basis, and a source with a 4 KiB in-place edit, a 777-byte insertion (shifting every later block off the block grid) and a 333-byte deletion. The destination is pre-seeded with the basis and backdated. The oc sender runs -a --no-whole-file --parallel-delta-scan with RAYON_NUM_THREADS swept over 1, 2, 4 and 8. Parallel engagement is observed with strace -e trace=mmap as the sender's whole-file PROT_READ, MAP_SHARED mapping of the source; the sequential path reads the file and never maps it. One thread is the negative control: the size gate needs more than one worker. Receiver: rsync version 3.5.1-g04355d27 protocol version 33.

transport threads parallel scan literal bytes destination
daemon 1 no (control) 30,540 identical
daemon 2 yes 30,540 identical
daemon 4 yes 30,540 identical
daemon 8 yes 30,540 identical
remote shell 1 no (control) 30,540 identical
remote shell 2 yes 30,540 identical
remote shell 4 yes 30,540 identical
remote shell 8 yes 30,540 identical

Before this change the remote-shell rows showed no parallel scan at any thread count; their destinations were still identical because the scan fell back to sequential.

Pulls

--parallel-delta-scan is not forwarded to a remote sender on a pull, deliberately: an upstream server rejects unknown options, and existing argv tests (kitchen_sink_config in the daemon and remote-shell argument builders) pin that. Measured on this branch, a pull from an oc daemon or an oc remote-shell server does not engage the remote scan. A server-side switch for pulls (daemon parameter and remote-shell environment variable) follows as a separate change.

Test plan

  • Per-transport tests that the push sender config carries the flag: rsh_push_sender_config_carries_parallel_delta_scan, daemon_push_sender_config_carries_parallel_delta_scan, embedded_ssh_push_sender_config_carries_parallel_delta_scan, plus apply_common_server_flags_carries_parallel_delta_scan.
  • Mutation check: removing the single assignment in apply_common_server_flags fails all four.
  • cargo nextest run -p matching --all-features (376 passed); core test(parallel_delta_scan); transfer test(delta) | test(chunked).
  • fmt, check_rustfmt_all.py, clippy on matching, core and transfer, dead_code_census.py, xtask no-placeholders.
  • CI: fmt + clippy, nextest (stable), Windows, macOS, Linux musl.

Coordination

Pre-merge checklist

  • Conventional commit prefix on PR title matches the change category.
  • cargo fmt --all run locally.
  • CHANGELOG.md updated if user-visible.
  • No references to internal tooling or non-human authoring aids; hyphens, not em-dashes.

@github-actions github-actions Bot added the bug Something isn't working label Oct 28, 2026
Carries the session_fork.rs fix from #8253 so this branch's macOS jobs stop
failing on the master test-harness race: on EPERM for our own child, SIGKILL
the leader before a blocking WNOWAIT wait, and accept a setpgid refusal when the
child already leads its own group. The content is identical to #8253, so the
two merge without conflict.
@oferchen oferchen closed this Oct 29, 2026
@oferchen oferchen reopened this Oct 29, 2026
@oferchen oferchen closed this Oct 29, 2026
@oferchen oferchen reopened this Oct 29, 2026
@oferchen oferchen closed this Oct 29, 2026
@oferchen oferchen reopened this Oct 29, 2026
@oferchen
oferchen merged commit 752bdec into master Oct 29, 2026
186 of 351 checks passed
@oferchen
oferchen deleted the feat/pds-gates branch October 29, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant