Repository navigation
feat(engine): DeleteEmitter scaffold for parallel deterministic delete (#2259) - #4260
Merged
Merged
Conversation
#2259) Scaffolds the single-threaded emitter half of the parallel-deterministic delete pipeline (design: parallel-deterministic-delete.md). Lands the DeleteFs trait so the dispatch table per upstream entry kind (delete.c delete_item:144-176) is mockable in tests, a RealDeleteFs production impl backed by std::fs, a RecordingDeleteFs test fake that captures the syscall sequence, and the DeleteEmitter::emit_all drain loop that walks DirTraversalCursor in upstream traversal order and increments DeleteStats per planned entry. The DeletePlan, DeletePlanMap, and DirTraversalCursor types are declared as in-file placeholders (matching the names DDP-A3 #2253 and DDP-A4 #2254 will produce) so the scaffold is independently mergeable; the type substitution at merge is mechanical. Syscall hardening (DDP-C2 #2260) and upstream error policy (DDP-C3 #2261) come next. Tests cover the empty-map base case, the full File/Dir/Symlink/ Device/Special dispatch matrix, multi-directory cursor-order traversal with within-directory plan order, and the cursor-outpaces-plans gap where emit_all parks and resumes on a later call.
oferchen
force-pushed
the
feat/delete-emitter-scaffold-2259
branch
from
May 17, 2026 20:25
8ccce92 to
b2536f8
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
#2259) (#4260) Scaffolds the single-threaded emitter half of the parallel-deterministic delete pipeline (design: parallel-deterministic-delete.md). Lands the DeleteFs trait so the dispatch table per upstream entry kind (delete.c delete_item:144-176) is mockable in tests, a RealDeleteFs production impl backed by std::fs, a RecordingDeleteFs test fake that captures the syscall sequence, and the DeleteEmitter::emit_all drain loop that walks DirTraversalCursor in upstream traversal order and increments DeleteStats per planned entry. The DeletePlan, DeletePlanMap, and DirTraversalCursor types are declared as in-file placeholders (matching the names DDP-A3 #2253 and DDP-A4 #2254 will produce) so the scaffold is independently mergeable; the type substitution at merge is mechanical. Syscall hardening (DDP-C2 #2260) and upstream error policy (DDP-C3 #2261) come next. Tests cover the empty-map base case, the full File/Dir/Symlink/ Device/Special dispatch matrix, multi-directory cursor-order traversal with within-directory plan order, and the cursor-outpaces-plans gap where emit_all parks and resumes on a later call.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
#2259) (#4260) Scaffolds the single-threaded emitter half of the parallel-deterministic delete pipeline (design: parallel-deterministic-delete.md). Lands the DeleteFs trait so the dispatch table per upstream entry kind (delete.c delete_item:144-176) is mockable in tests, a RealDeleteFs production impl backed by std::fs, a RecordingDeleteFs test fake that captures the syscall sequence, and the DeleteEmitter::emit_all drain loop that walks DirTraversalCursor in upstream traversal order and increments DeleteStats per planned entry. The DeletePlan, DeletePlanMap, and DirTraversalCursor types are declared as in-file placeholders (matching the names DDP-A3 #2253 and DDP-A4 #2254 will produce) so the scaffold is independently mergeable; the type substitution at merge is mechanical. Syscall hardening (DDP-C2 #2260) and upstream error policy (DDP-C3 #2261) come next. Tests cover the empty-map base case, the full File/Dir/Symlink/ Device/Special dispatch matrix, multi-directory cursor-order traversal with within-directory plan order, and the cursor-outpaces-plans gap where emit_all parks and resumes on a later call.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
#2259) (#4260) Scaffolds the single-threaded emitter half of the parallel-deterministic delete pipeline (design: parallel-deterministic-delete.md). Lands the DeleteFs trait so the dispatch table per upstream entry kind (delete.c delete_item:144-176) is mockable in tests, a RealDeleteFs production impl backed by std::fs, a RecordingDeleteFs test fake that captures the syscall sequence, and the DeleteEmitter::emit_all drain loop that walks DirTraversalCursor in upstream traversal order and increments DeleteStats per planned entry. The DeletePlan, DeletePlanMap, and DirTraversalCursor types are declared as in-file placeholders (matching the names DDP-A3 #2253 and DDP-A4 #2254 will produce) so the scaffold is independently mergeable; the type substitution at merge is mechanical. Syscall hardening (DDP-C2 #2260) and upstream error policy (DDP-C3 #2261) come next. Tests cover the empty-map base case, the full File/Dir/Symlink/ Device/Special dispatch matrix, multi-directory cursor-order traversal with within-directory plan order, and the cursor-outpaces-plans gap where emit_all parks and resumes on a later call.
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
DeleteEmitter, the single-threaded drain task for the parallel-deterministic delete pipeline (design:docs/design/parallel-deterministic-delete.md). The emitter is the single writer of every observable delete side effect, preserving the invariant that wall-clockunlinkorder,*deletingitemize order, andNDX_DEL_STATSframing match upstream rsync 3.4.1 byte for byte.DeleteFstrait carving one method per upstream-distinguishable entry kind (delete.c::delete_item:144-176), the productionRealDeleteFsimpl backed bystd::fs, and aRecordingDeleteFstest fake that captures the dispatch sequence without touching the filesystem.DeletePlan/PlannedDelete/DeletePlanMap/DirTraversalCursortypes insideemitter.rsusing the exact names from DDP-A3 (Stop delegating --server to external fallback #2253) and DDP-A4 (Stop delegating --server to fallback binary #2254), so substitution at merge is mechanical.Scope
In scope (task DDP-C1, #2259):
crates/engine/src/delete/mod.rsdeclaringpub mod emitter;.crates/engine/src/delete/emitter.rswith the trait, fakes, struct, and skeletonemit_allloop.Out of scope (subsequent DDP-C tasks):
io_error & IOERR_GENERAL,--max-delete,ENOTEMPTY(DDP-C3, Update internal docs to reflect native-only operation #2261).MsgInfoSenderwiring for*deletingitemize lines.Test plan
cargo fmt --allcleancargo nextest run -p engine --all-features -E 'test(delete::emitter)'-- 5 / 5 passcargo check -p engine --testscleancargo clippy -p engine --all-targets --all-features --no-depsclean for the new module (a pre-existing bench warning onadaptive_bufferpool.rsis unrelated and already on master)Test cases
Ok(())immediately, no events recorded, zero stats.File -> unlink_file,Directory -> rmdir,Symlink -> unlink_symlink,Device -> unlink_device,Special -> unlink_special, withDeleteStatsincremented for each.compute_extras; seegenerator.c:320).Ok, and resumes correctly on a lateremit_allcall once the plan is published.RealDeleteFssmoke test on atempfile::tempdirexercisingunlink_file+rmdiragainst real filesystem state.Cross-PR coordination
This PR runs in parallel with the DDP-A3+A4 PR (
DeletePlan/DeletePlanMap/DirTraversalCursoratcrates/engine/src/delete/). Both PRs addpub mod delete;tocrates/engine/src/lib.rs; the second to merge resolves the trivial conflict by keeping a single declaration. The placeholder types inside this PR'semitter.rsare named identically to the design spec so DDP-A3+A4 can replace them withuseimports without touching the emitter logic.