Repository navigation
docs(design): parallel-flist deterministic delete (#2251) - #4257
Merged
Merged
Conversation
Establishes the two-phase model (parallel compute_extras, single emitter drain) that replaces the batched --delete-during sweep and the opt-in --delete-strict-order gate from PR #4245. Locks down the invariants the implementation tasks (#2252-#2285) must preserve: upstream f_name_cmp ordering per directory, depth-first directory order, single-emitter side effects, per-directory filter snapshot, pure workers. Covers all timing modes, hardlink coordination, error policy, removal plan for the strict-order flag and batched sweep, plus the interop, determinism, and perf test plan.
4 tasks
oferchen
added a commit
that referenced
this pull request
May 17, 2026
…lel deterministic delete (#2253, #2254) (#4259) * feat(engine): DeletePlan, DeletePlanMap, DirTraversalCursor (#2253, #2254) Adds the data-structure foundation for the parallel-deterministic-delete pipeline described in docs/design/parallel-deterministic-delete.md (PR #4257). Three new modules under crates/engine/src/delete/: - plan.rs: DeletePlan (sorted, frozen per-directory work item), DeleteEntry, DeleteEntryKind (mirrors DeleteStats buckets), and a HardlinkCohortId newtype. sort_by_name() uses upstream's f_name_cmp (PR #4256) ascending then reverses, matching delete_in_dir's loop at generator.c:320. - plan_map.rs: DeletePlanMap, the publish-once concurrent rendezvous between phase-1 workers and the phase-2 emitter. Backed by Mutex<HashMap> for now; bench-driven choice between Mutex, DashMap, and a sharded map is deferred to task DDP-B4 (see code comment). - traversal.rs: DirTraversalCursor, yields directories in upstream's depth-first f_name_cmp-ascending order. Tree built from observed flist segments via observe_segment(); next_ready() returns the next directory whose parent has been emitted. Pure data structures, no callers; phase-1 and phase-2 wiring lands in later tasks (#2255-#2278). Unit tests cover plan ordering, concurrent inserts and takes from 16 threads, out-of-order segment observation, non-directory filtering, duplicate observations, and high-byte basename ordering on Unix. * fix(engine): avoid borrow-checker conflict in DirTraversalCursor::next_ready Splits the frame inspection from the mutation so the mutable borrow of the top frame is released before pushing a new frame or popping the old one. Functionally equivalent.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Establishes the two-phase model (parallel compute_extras, single emitter drain) that replaces the batched --delete-during sweep and the opt-in --delete-strict-order gate from PR #4245. Locks down the invariants the implementation tasks (#2252-#2285) must preserve: upstream f_name_cmp ordering per directory, depth-first directory order, single-emitter side effects, per-directory filter snapshot, pure workers. Covers all timing modes, hardlink coordination, error policy, removal plan for the strict-order flag and batched sweep, plus the interop, determinism, and perf test plan.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…lel deterministic delete (#2253, #2254) (#4259) * feat(engine): DeletePlan, DeletePlanMap, DirTraversalCursor (#2253, #2254) Adds the data-structure foundation for the parallel-deterministic-delete pipeline described in docs/design/parallel-deterministic-delete.md (PR #4257). Three new modules under crates/engine/src/delete/: - plan.rs: DeletePlan (sorted, frozen per-directory work item), DeleteEntry, DeleteEntryKind (mirrors DeleteStats buckets), and a HardlinkCohortId newtype. sort_by_name() uses upstream's f_name_cmp (PR #4256) ascending then reverses, matching delete_in_dir's loop at generator.c:320. - plan_map.rs: DeletePlanMap, the publish-once concurrent rendezvous between phase-1 workers and the phase-2 emitter. Backed by Mutex<HashMap> for now; bench-driven choice between Mutex, DashMap, and a sharded map is deferred to task DDP-B4 (see code comment). - traversal.rs: DirTraversalCursor, yields directories in upstream's depth-first f_name_cmp-ascending order. Tree built from observed flist segments via observe_segment(); next_ready() returns the next directory whose parent has been emitted. Pure data structures, no callers; phase-1 and phase-2 wiring lands in later tasks (#2255-#2278). Unit tests cover plan ordering, concurrent inserts and takes from 16 threads, out-of-order segment observation, non-directory filtering, duplicate observations, and high-byte basename ordering on Unix. * fix(engine): avoid borrow-checker conflict in DirTraversalCursor::next_ready Splits the frame inspection from the mutation so the mutable borrow of the top frame is released before pushing a new frame or popping the old one. Functionally equivalent.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Establishes the two-phase model (parallel compute_extras, single emitter drain) that replaces the batched --delete-during sweep and the opt-in --delete-strict-order gate from PR #4245. Locks down the invariants the implementation tasks (#2252-#2285) must preserve: upstream f_name_cmp ordering per directory, depth-first directory order, single-emitter side effects, per-directory filter snapshot, pure workers. Covers all timing modes, hardlink coordination, error policy, removal plan for the strict-order flag and batched sweep, plus the interop, determinism, and perf test plan.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…lel deterministic delete (#2253, #2254) (#4259) * feat(engine): DeletePlan, DeletePlanMap, DirTraversalCursor (#2253, #2254) Adds the data-structure foundation for the parallel-deterministic-delete pipeline described in docs/design/parallel-deterministic-delete.md (PR #4257). Three new modules under crates/engine/src/delete/: - plan.rs: DeletePlan (sorted, frozen per-directory work item), DeleteEntry, DeleteEntryKind (mirrors DeleteStats buckets), and a HardlinkCohortId newtype. sort_by_name() uses upstream's f_name_cmp (PR #4256) ascending then reverses, matching delete_in_dir's loop at generator.c:320. - plan_map.rs: DeletePlanMap, the publish-once concurrent rendezvous between phase-1 workers and the phase-2 emitter. Backed by Mutex<HashMap> for now; bench-driven choice between Mutex, DashMap, and a sharded map is deferred to task DDP-B4 (see code comment). - traversal.rs: DirTraversalCursor, yields directories in upstream's depth-first f_name_cmp-ascending order. Tree built from observed flist segments via observe_segment(); next_ready() returns the next directory whose parent has been emitted. Pure data structures, no callers; phase-1 and phase-2 wiring lands in later tasks (#2255-#2278). Unit tests cover plan ordering, concurrent inserts and takes from 16 threads, out-of-order segment observation, non-directory filtering, duplicate observations, and high-byte basename ordering on Unix. * fix(engine): avoid borrow-checker conflict in DirTraversalCursor::next_ready Splits the frame inspection from the mutation so the mutable borrow of the top frame is released before pushing a new frame or popping the old one. Functionally equivalent.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Establishes the two-phase model (parallel compute_extras, single emitter drain) that replaces the batched --delete-during sweep and the opt-in --delete-strict-order gate from PR #4245. Locks down the invariants the implementation tasks (#2252-#2285) must preserve: upstream f_name_cmp ordering per directory, depth-first directory order, single-emitter side effects, per-directory filter snapshot, pure workers. Covers all timing modes, hardlink coordination, error policy, removal plan for the strict-order flag and batched sweep, plus the interop, determinism, and perf test plan.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…lel deterministic delete (#2253, #2254) (#4259) * feat(engine): DeletePlan, DeletePlanMap, DirTraversalCursor (#2253, #2254) Adds the data-structure foundation for the parallel-deterministic-delete pipeline described in docs/design/parallel-deterministic-delete.md (PR #4257). Three new modules under crates/engine/src/delete/: - plan.rs: DeletePlan (sorted, frozen per-directory work item), DeleteEntry, DeleteEntryKind (mirrors DeleteStats buckets), and a HardlinkCohortId newtype. sort_by_name() uses upstream's f_name_cmp (PR #4256) ascending then reverses, matching delete_in_dir's loop at generator.c:320. - plan_map.rs: DeletePlanMap, the publish-once concurrent rendezvous between phase-1 workers and the phase-2 emitter. Backed by Mutex<HashMap> for now; bench-driven choice between Mutex, DashMap, and a sharded map is deferred to task DDP-B4 (see code comment). - traversal.rs: DirTraversalCursor, yields directories in upstream's depth-first f_name_cmp-ascending order. Tree built from observed flist segments via observe_segment(); next_ready() returns the next directory whose parent has been emitted. Pure data structures, no callers; phase-1 and phase-2 wiring lands in later tasks (#2255-#2278). Unit tests cover plan ordering, concurrent inserts and takes from 16 threads, out-of-order segment observation, non-directory filtering, duplicate observations, and high-byte basename ordering on Unix. * fix(engine): avoid borrow-checker conflict in DirTraversalCursor::next_ready Splits the frame inspection from the mutation so the mutable borrow of the top frame is released before pushing a new frame or popping the old one. Functionally equivalent.
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
docs/design/parallel-deterministic-delete.md(task DDP-A1, Improve fallback spawn diagnostics #2251), the foundation design for feat: Phase 1 - Comprehensive Parity Gap Analysis #2252-chore: update Homebrew formula for v0.5.1 #2285.compute_extrasworkers publish frozenDeletePlans into aDeletePlanMap; a single emitter drains them in upstream depth-first /f_name_cmp-reversed order. Wall-clock unlink, itemize, andMSG_INFOorder match upstream rsync 3.4.1 byte-for-byte.--delete-strict-order(PR feat(cli): --delete-strict-order opt-in gate for --delete-during (#1940) #4245) and the batcheddelete_extraneous_filessweep. No user-visible flag, no fallback.What the doc establishes
f_name_cmpsemantics cited toflist.c:3217-3343; reuses our existingcompare_file_entriesport (crates/protocol/src/flist/sort.rs:60).DeletePlan,DeletePlanMap(DashMap ofOnceLock), andDirTraversalCursortype sketches.--delete-before,--delete-during,--delete-after,--delete-delay,--delete-excluded, each cited to its upstream call site.flist_find_ignore_dirness).generator.c:291-298(IOERR_GENERALskip) and--max-deleteexhaustion.cli/core/engine) and the batched sweep.Test plan
delete_strict_orderlands 94 hits; doc lists every file).target/interop/upstream-src/rsync-3.4.1/.