Repository navigation
fix(protocol): separate preserve_devices and preserve_specials flags - #2507
Merged
Merged
Conversation
- Split combined preserve_devices flag into separate preserve_devices and preserve_specials flags to match upstream rsync behavior - Update FileListWriter/FileListReader with separate builder methods - Update flist batched_writer, receiver, and device encoding tests - Upstream rsync tracks these independently for -D (--devices --specials) vs individual --devices or --specials flags
oferchen
force-pushed
the
fix/separate-devices-specials
branch
from
February 27, 2026 03:37
5442587 to
ba86b16
Compare
oferchen
added a commit
that referenced
this pull request
May 1, 2026
fix(protocol): separate preserve_devices and preserve_specials flags
oferchen
added a commit
that referenced
this pull request
May 5, 2026
fix(protocol): separate preserve_devices and preserve_specials flags
5 of 6 tasks
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
…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).
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.
Summary
preserve_devicesflag into separatepreserve_devicesandpreserve_specialsflagsFileListWriter/FileListReaderwith separate builder methods for each flag-Denables both, but--devicesand--specialscan be used individuallyTest plan
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets --all-features --no-deps -- -D warningspassescargo nextest run --workspace --all-featurespasses--devices,--specials, and-D