Skip to content

feat(core): complete server invocation builder with all flag forwarding - #2503

Merged
oferchen merged 1 commit into
masterfrom
feat/server-invocation-completeness
Feb 27, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/server-invocation-completeness

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Complete the server invocation builder to forward all CLI flags to the remote rsync server process
  • Adds ~30 missing flag categories: archive options, delete variants, compress/checksum, partial/sparse/inplace, filter rules, timeout/bwlimit, ACLs/xattrs/hard-links, and remaining flags
  • Ensures wire-compatibility with upstream rsync 3.4.1 server args

Test plan

  • Verify cargo fmt --all -- --check passes
  • Verify cargo clippy --workspace --all-targets --all-features --no-deps -D warnings passes
  • Verify cargo nextest run --workspace --all-features passes
  • Verify server invocation output matches upstream rsync for common flag combinations

Add comprehensive server-args forwarding for all remaining rsync options:
archive sub-options, delete variants, compression/checksum, partial/sparse/
inplace, filter rules, timeout/bandwidth, ACLs/xattrs/hard-links, and ~20
remaining flags.
@github-actions github-actions Bot added the enhancement New feature or request label Feb 27, 2026
@oferchen
oferchen merged commit 0cfb226 into master Feb 27, 2026
31 checks passed
@oferchen
oferchen deleted the feat/server-invocation-completeness branch February 27, 2026 09:46
oferchen added a commit that referenced this pull request May 1, 2026
…eness

feat(core): complete server invocation builder with all flag forwarding
oferchen added a commit that referenced this pull request May 5, 2026
…eness

feat(core): complete server invocation builder with all flag forwarding
oferchen added a commit that referenced this pull request May 20, 2026
…4600)

Read-only audit for #2503. Evaluates DashMap vs hand-rolled sharded
Mutex<HashMap> as the replacement for the outer mutex on
ParallelDeltaApplier.files. Picks DashMap and sketches the API shape
for BR-3j.c to implement against.
oferchen added a commit that referenced this pull request May 21, 2026
BR-3j.a (PR #4600) selected DashMap to replace the outer
`Mutex<HashMap<FileNdx, Arc<Mutex<FileSlot>>>>` map in
`ParallelDeltaApplier`. The outer mutex serialised every per-chunk slot
lookup behind a single global lock, defeating the per-file fanout the
rest of the applier was built around (#2503, BR-3j.c).

This commit performs the source migration:

- `files: Mutex<HashMap<...>>` -> `files: DashMap<FileNdx, Arc<Mutex<FileSlot>>>`
- `register_file` uses `Entry::Vacant`/`Entry::Occupied` and pre-builds
  the slot Arc outside the shard guard so the reorder-buffer allocation
  never widens the lock window.
- `slot_for` clones the Arc and drops the shard read guard at the end
  of the expression; callers never see the DashMap guard, so they
  cannot accidentally hold it across the per-file mutex lock or a
  rayon dispatch.
- `finish_file` uses `DashMap::remove` which returns the owned `(K, V)`
  and drops the shard guard before `Arc::try_unwrap`.
- `Debug` reads `self.files.len()` directly.

The inner `Mutex<FileSlot>` is preserved: it remains the sole gate for
per-file writes so submission order is still enforced through the
`ReorderBuffer`. Public API of `ParallelDeltaApplier` is unchanged.

Adds a concurrency stress test
(`crates/engine/tests/parallel_apply_concurrent.rs`, BR-3j.e #2507)
that spawns N rayon workers each picking a random FileNdx from a pool
of 1000 files and verifies bytes_written matches expected. A second
test races registration and dispatch on overlapping files and asserts
the applier surfaces only typed errors (never panics or corrupts).
On the dev box the stress test reports ~2.17M ops/sec (8 workers,
1000 files, 10000 ops).

No unsafe code added. No clippy waivers. `cargo build -p engine
--no-default-features` still compiles. Targeted nextest runs for
`concurrent_delta` and `parallel_apply` binaries all pass (340 tests
including the 2 new stress tests).
oferchen added a commit that referenced this pull request May 21, 2026
…ap (#4634)

BR-3j.a (PR #4600) selected DashMap to replace the outer
`Mutex<HashMap<FileNdx, Arc<Mutex<FileSlot>>>>` map in
`ParallelDeltaApplier`. The outer mutex serialised every per-chunk slot
lookup behind a single global lock, defeating the per-file fanout the
rest of the applier was built around (#2503, BR-3j.c).

This commit performs the source migration:

- `files: Mutex<HashMap<...>>` -> `files: DashMap<FileNdx, Arc<Mutex<FileSlot>>>`
- `register_file` uses `Entry::Vacant`/`Entry::Occupied` and pre-builds
  the slot Arc outside the shard guard so the reorder-buffer allocation
  never widens the lock window.
- `slot_for` clones the Arc and drops the shard read guard at the end
  of the expression; callers never see the DashMap guard, so they
  cannot accidentally hold it across the per-file mutex lock or a
  rayon dispatch.
- `finish_file` uses `DashMap::remove` which returns the owned `(K, V)`
  and drops the shard guard before `Arc::try_unwrap`.
- `Debug` reads `self.files.len()` directly.

The inner `Mutex<FileSlot>` is preserved: it remains the sole gate for
per-file writes so submission order is still enforced through the
`ReorderBuffer`. Public API of `ParallelDeltaApplier` is unchanged.

Adds a concurrency stress test
(`crates/engine/tests/parallel_apply_concurrent.rs`, BR-3j.e #2507)
that spawns N rayon workers each picking a random FileNdx from a pool
of 1000 files and verifies bytes_written matches expected. A second
test races registration and dispatch on overlapping files and asserts
the applier surfaces only typed errors (never panics or corrupts).
On the dev box the stress test reports ~2.17M ops/sec (8 workers,
1000 files, 10000 ops).

No unsafe code added. No clippy waivers. `cargo build -p engine
--no-default-features` still compiles. Targeted nextest runs for
`concurrent_delta` and `parallel_apply` binaries all pass (340 tests
including the 2 new stress tests).
oferchen added a commit that referenced this pull request Aug 24, 2026
…4600)

Read-only audit for #2503. Evaluates DashMap vs hand-rolled sharded
Mutex<HashMap> as the replacement for the outer mutex on
ParallelDeltaApplier.files. Picks DashMap and sketches the API shape
for BR-3j.c to implement against.
oferchen added a commit that referenced this pull request Aug 24, 2026
…ap (#4634)

BR-3j.a (PR #4600) selected DashMap to replace the outer
`Mutex<HashMap<FileNdx, Arc<Mutex<FileSlot>>>>` map in
`ParallelDeltaApplier`. The outer mutex serialised every per-chunk slot
lookup behind a single global lock, defeating the per-file fanout the
rest of the applier was built around (#2503, BR-3j.c).

This commit performs the source migration:

- `files: Mutex<HashMap<...>>` -> `files: DashMap<FileNdx, Arc<Mutex<FileSlot>>>`
- `register_file` uses `Entry::Vacant`/`Entry::Occupied` and pre-builds
  the slot Arc outside the shard guard so the reorder-buffer allocation
  never widens the lock window.
- `slot_for` clones the Arc and drops the shard read guard at the end
  of the expression; callers never see the DashMap guard, so they
  cannot accidentally hold it across the per-file mutex lock or a
  rayon dispatch.
- `finish_file` uses `DashMap::remove` which returns the owned `(K, V)`
  and drops the shard guard before `Arc::try_unwrap`.
- `Debug` reads `self.files.len()` directly.

The inner `Mutex<FileSlot>` is preserved: it remains the sole gate for
per-file writes so submission order is still enforced through the
`ReorderBuffer`. Public API of `ParallelDeltaApplier` is unchanged.

Adds a concurrency stress test
(`crates/engine/tests/parallel_apply_concurrent.rs`, BR-3j.e #2507)
that spawns N rayon workers each picking a random FileNdx from a pool
of 1000 files and verifies bytes_written matches expected. A second
test races registration and dispatch on overlapping files and asserts
the applier surfaces only typed errors (never panics or corrupts).
On the dev box the stress test reports ~2.17M ops/sec (8 workers,
1000 files, 10000 ops).

No unsafe code added. No clippy waivers. `cargo build -p engine
--no-default-features` still compiles. Targeted nextest runs for
`concurrent_delta` and `parallel_apply` binaries all pass (340 tests
including the 2 new stress tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant