Skip to content

feat(cli): --delete-strict-order opt-in gate for --delete-during (#1940) - #4245

Merged
oferchen merged 1 commit into
masterfrom
feat/delete-strict-order-1940
May 17, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/delete-strict-order-1940

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds --delete-strict-order / --no-delete-strict-order CLI flags (default off) that switch --delete-during from the existing batched post-transfer sweep to upstream's interleaved walk-then-delete (delete_in_dir() at generator.c:1520-1526 and generator.c:2298-2310).
  • Plumbs the flag end-to-end: ParsedArgs -> ConfigInputs -> ClientConfig(Builder) -> LocalCopyOptions(Builder) -> directory recursion executor.
  • The toggle is inert under --delete-before, --delete-delay, and --delete-after, which already match upstream ordering.

Implementation notes

  • Builder/setter style follows the existing --adaptive-concurrency / --no-adaptive-concurrency pattern (positive-first tri-state).
  • The strict-order branch in copy_directory_recursive calls delete_extraneous_entries immediately after apply_pre_transfer_deletions (before child entries are processed) and suppresses the batched handle_post_transfer_deletions for that directory so each extraneous entry is deleted exactly once.
  • LocalCopyOptions::delete_strict_order_enabled() returns true only when both the opt-in flag is set and the resolved timing is During, so callers do not need to repeat that gating.

Test plan

  • crates/cli/src/frontend/arguments/parser/tests.rs - default, --delete-strict-order, --no-delete-strict-order, last-wins precedence between the two.
  • crates/engine/src/local_copy/options/deletion.rs - unit coverage for the gating: defaults, requires During timing, toggle off.
  • crates/engine/src/local_copy/tests/delete.rs::delete_strict_order_runs_sweep_before_children - integration test that under --delete-during --delete-strict-order, subdir/extra.txt deletion is recorded before subdir/new.txt copy in the event stream.
  • crates/engine/src/local_copy/tests/delete.rs::delete_strict_order_inactive_without_during_timing - confirms the toggle has no effect under After/Before/Delay timings.
  • cargo fmt --all clean.
  • CI green (fmt+clippy, nextest, Windows, macOS, Linux musl).

Adds `--delete-strict-order` / `--no-delete-strict-order` CLI flags (default
off) that switch `--delete-during` from the existing batched post-transfer
sweep to upstream's interleaved walk-then-delete - the receiver runs each
directory's deletion sweep before its children are processed, mirroring
`delete_in_dir()` at generator.c:1520-1526 and generator.c:2298-2310.

The toggle is plumbed end-to-end (ParsedArgs -> ConfigInputs ->
ClientConfig(Builder) -> LocalCopyOptions(Builder)) and is inert under
Before/Delay/After timings, which already match upstream. Adds unit
coverage for the option gating, the parser surface, and an executor-level
integration test that verifies `subdir/extra.txt` is removed before
`subdir/new.txt` is written under strict-order semantics.
@github-actions github-actions Bot added the enhancement New feature or request label May 17, 2026
@oferchen
oferchen merged commit 25341d2 into master May 17, 2026
13 checks passed
oferchen added a commit that referenced this pull request May 17, 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 17, 2026
Part of the DDP (parallel-flist deterministic delete) series. The
opt-in `--delete-strict-order` flag (PR #4245, issue #1940) is
replaced by a single deterministic per-directory deletion model
described in docs/design/parallel-deterministic-delete.md. The new
emitter wiring lands in DDP-E1..E5; until then the existing batched
post-transfer sweep remains the live `--delete-during` path, so this
PR removes only the flag, not the sweep. DDP-F3 (sweep removal) will
follow once the emitter is wired as the live replacement.

Removed across cli, core, and engine: the CLI argument definitions,
parsed-args field, parser plumbing, help and supported-options
strings, ClientConfig field/setter/accessor/default test, the run
plumbing into LocalCopyOptions, the engine options field/setter/
accessor and four unit tests, the builder field/setter/default, and
the strict-order branch plus the suppressed-post-transfer-sweep gate
in the recursive directory executor.

Closes #2270, #2271, #2273, #2274.
oferchen added a commit that referenced this pull request May 18, 2026
…4245)

Adds `--delete-strict-order` / `--no-delete-strict-order` CLI flags (default
off) that switch `--delete-during` from the existing batched post-transfer
sweep to upstream's interleaved walk-then-delete - the receiver runs each
directory's deletion sweep before its children are processed, mirroring
`delete_in_dir()` at generator.c:1520-1526 and generator.c:2298-2310.

The toggle is plumbed end-to-end (ParsedArgs -> ConfigInputs ->
ClientConfig(Builder) -> LocalCopyOptions(Builder)) and is inert under
Before/Delay/After timings, which already match upstream. Adds unit
coverage for the option gating, the parser surface, and an executor-level
integration test that verifies `subdir/extra.txt` is removed before
`subdir/new.txt` is written under strict-order semantics.
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
Part of the DDP (parallel-flist deterministic delete) series. The
opt-in `--delete-strict-order` flag (PR #4245, issue #1940) is
replaced by a single deterministic per-directory deletion model
described in docs/design/parallel-deterministic-delete.md. The new
emitter wiring lands in DDP-E1..E5; until then the existing batched
post-transfer sweep remains the live `--delete-during` path, so this
PR removes only the flag, not the sweep. DDP-F3 (sweep removal) will
follow once the emitter is wired as the live replacement.

Removed across cli, core, and engine: the CLI argument definitions,
parsed-args field, parser plumbing, help and supported-options
strings, ClientConfig field/setter/accessor/default test, the run
plumbing into LocalCopyOptions, the engine options field/setter/
accessor and four unit tests, the builder field/setter/default, and
the strict-order branch plus the suppressed-post-transfer-sweep gate
in the recursive directory executor.

Closes #2270, #2271, #2273, #2274.
oferchen added a commit that referenced this pull request May 18, 2026
…4245)

Adds `--delete-strict-order` / `--no-delete-strict-order` CLI flags (default
off) that switch `--delete-during` from the existing batched post-transfer
sweep to upstream's interleaved walk-then-delete - the receiver runs each
directory's deletion sweep before its children are processed, mirroring
`delete_in_dir()` at generator.c:1520-1526 and generator.c:2298-2310.

The toggle is plumbed end-to-end (ParsedArgs -> ConfigInputs ->
ClientConfig(Builder) -> LocalCopyOptions(Builder)) and is inert under
Before/Delay/After timings, which already match upstream. Adds unit
coverage for the option gating, the parser surface, and an executor-level
integration test that verifies `subdir/extra.txt` is removed before
`subdir/new.txt` is written under strict-order semantics.
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
Part of the DDP (parallel-flist deterministic delete) series. The
opt-in `--delete-strict-order` flag (PR #4245, issue #1940) is
replaced by a single deterministic per-directory deletion model
described in docs/design/parallel-deterministic-delete.md. The new
emitter wiring lands in DDP-E1..E5; until then the existing batched
post-transfer sweep remains the live `--delete-during` path, so this
PR removes only the flag, not the sweep. DDP-F3 (sweep removal) will
follow once the emitter is wired as the live replacement.

Removed across cli, core, and engine: the CLI argument definitions,
parsed-args field, parser plumbing, help and supported-options
strings, ClientConfig field/setter/accessor/default test, the run
plumbing into LocalCopyOptions, the engine options field/setter/
accessor and four unit tests, the builder field/setter/default, and
the strict-order branch plus the suppressed-post-transfer-sweep gate
in the recursive directory executor.

Closes #2270, #2271, #2273, #2274.
@oferchen
oferchen deleted the feat/delete-strict-order-1940 branch May 19, 2026 19:27
oferchen added a commit that referenced this pull request Aug 24, 2026
…4245)

Adds `--delete-strict-order` / `--no-delete-strict-order` CLI flags (default
off) that switch `--delete-during` from the existing batched post-transfer
sweep to upstream's interleaved walk-then-delete - the receiver runs each
directory's deletion sweep before its children are processed, mirroring
`delete_in_dir()` at generator.c:1520-1526 and generator.c:2298-2310.

The toggle is plumbed end-to-end (ParsedArgs -> ConfigInputs ->
ClientConfig(Builder) -> LocalCopyOptions(Builder)) and is inert under
Before/Delay/After timings, which already match upstream. Adds unit
coverage for the option gating, the parser surface, and an executor-level
integration test that verifies `subdir/extra.txt` is removed before
`subdir/new.txt` is written under strict-order semantics.
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
Part of the DDP (parallel-flist deterministic delete) series. The
opt-in `--delete-strict-order` flag (PR #4245, issue #1940) is
replaced by a single deterministic per-directory deletion model
described in docs/design/parallel-deterministic-delete.md. The new
emitter wiring lands in DDP-E1..E5; until then the existing batched
post-transfer sweep remains the live `--delete-during` path, so this
PR removes only the flag, not the sweep. DDP-F3 (sweep removal) will
follow once the emitter is wired as the live replacement.

Removed across cli, core, and engine: the CLI argument definitions,
parsed-args field, parser plumbing, help and supported-options
strings, ClientConfig field/setter/accessor/default test, the run
plumbing into LocalCopyOptions, the engine options field/setter/
accessor and four unit tests, the builder field/setter/default, and
the strict-order branch plus the suppressed-post-transfer-sweep gate
in the recursive directory executor.

Closes #2270, #2271, #2273, #2274.
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