Skip to content

fix: forward --stats into daemon, drain Sync flush, normalize delete path - #5520

Merged
oferchen merged 4 commits into
masterfrom
fix/uts-stream-c-daemon-wire
Jun 10, 2026
Merged

oferchen merged 4 commits into
masterfrom
fix/uts-stream-c-daemon-wire

Conversation

@oferchen

@oferchen oferchen commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Three independent fixes for upstream rsync 3.4.3 testsuite failures on the daemon-side wire format:

  • daemon-delete-stats (UTS-6, fix(workspace): expose embedded-ssh facade feature on root crate #3569): the daemon never propagated --stats to ServerConfig.do_stats, so the generator skipped emitting NDX_DEL_STATS during the goodbye phase and the client's "Number of deleted files" stat stayed at zero on daemon uploads. Wire --stats into both the daemon's long-form arg parser and the server-mode flag parser.
  • daemon-delete-stats (UTS-6): delete_extraneous_files() consulted the filter chain with "./<name>" at the deletion root. A daemon-side exclude = ? rule then matched the . as a single-character parent component via the descendant matcher ?/**, silently suppressing every legitimate top-level delete. Strip the implicit . prefix.
  • compress-zlib-insert (UTS-18, docs(engine): comment cleanup for local_copy::deletion (#1947) #3581): ZlibTokenEncoder::see_token() called Compress::compress(..., Z_SYNC_FLUSH) once per 0xFFFF chunk. A 64 KiB incompressible matched-block insert emits stored-block output > compress_buf, leaving residue trapped inside the deflate state that desynchronises the next literal write. Mirrors upstream rsync issue Handle unbracketed IPv6 daemon operands #951. Loop the Sync flush, discarding output, until the chunk is consumed and the buffer is partially filled.

daemon-gzip-upload (UTS-10) and daemon-gzip-download (UTS-9) already passed on master and are validated as part of the same testsuite run.

Test plan

  • CI nextest (stable) passes
  • CI fmt + clippy passes
  • CI Windows, macOS, Linux musl pass
  • Upstream testsuite cell (IFX-15) runs daemon-delete-stats, daemon-gzip-download, daemon-gzip-upload, compress-zlib-insert against rsync 3.4.3 and the four go green
  • New filter regression test single_char_wildcard_exclude_does_not_block_top_level_deletion passes
  • New filter unit test single_char_wildcard_does_not_match_multichar_names passes
  • New encoder regression test see_token_large_incompressible_insert_no_overflow passes

@github-actions github-actions Bot added the bug Something isn't working label Jun 9, 2026
…path

Three independent fixes shake out interop failures from upstream rsync
3.4.3's testsuite that exercise daemon-side wire format on the receiver:

- daemon-delete-stats (UTS-6): the daemon never set `do_stats` from the
  client's `--stats` flag, so the generator skipped emitting
  `NDX_DEL_STATS` during the goodbye phase and the sender's stats
  showed "Number of deleted files: 0". Wire `--stats` into both the
  daemon's long-form arg parser and the server-mode flag parser.

- daemon-delete-stats (UTS-6): `delete_extraneous_files()` formed the
  filter check and itemize path as `dir_relative.join(name)`, which at
  the deletion root produced `./<name>`. A daemon-side `exclude = ?`
  rule then matched the `.` as a single-character directory component
  (via the descendant matcher `?/**`), suppressing legitimate top-level
  deletes. Strip the implicit `.` prefix when `dir_relative == "."`.

- compress-zlib-insert (UTS-18): `ZlibTokenEncoder::see_token()` called
  `compress(..., Z_SYNC_FLUSH)` exactly once per 0xFFFF chunk. A 64 KiB
  incompressible matched-block insert emits stored-block output >
  `compress_buf` (CHUNK_SIZE * 2), leaving residue inside the deflate
  state. The next literal write picks up the trapped output and
  desynchronises the stream, matching upstream rsync's issue #951.
  Loop the Sync flush, discarding output until the chunk is consumed
  and the compressor partially fills the buffer (signalling no more
  pending output).

Regression tests cover the daemon-side filter behaviour, the
single-char-glob deletion case, and the large incompressible insert.
@oferchen
oferchen force-pushed the fix/uts-stream-c-daemon-wire branch from 90ec600 to a6f6c30 Compare June 10, 2026 02:58
oferchen added a commit that referenced this pull request Jun 10, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root
cause rather than by Stream bucket. Seven clusters surface; the parser-
stores-string and field-vs-method shadowing clusters cover the largest
share of the series, and the receiver-driver wiring-parity gap explains
the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a
defense-in-depth audit mapping each cluster onto the rust-landlock
ruleset wired at crates/fast_io/src/landlock.rs.

Doc-only; no code paths touched.
oferchen added a commit that referenced this pull request Jun 10, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root
cause rather than by Stream bucket. Seven clusters surface; the parser-
stores-string and field-vs-method shadowing clusters cover the largest
share of the series, and the receiver-driver wiring-parity gap explains
the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a
defense-in-depth audit mapping each cluster onto the rust-landlock
ruleset wired at crates/fast_io/src/landlock.rs.

Doc-only; no code paths touched.
@oferchen
oferchen merged commit 31e0d8d into master Jun 10, 2026
70 checks passed
@oferchen
oferchen deleted the fix/uts-stream-c-daemon-wire branch June 10, 2026 10:03
oferchen added a commit that referenced this pull request Jun 19, 2026
UTS-NEXTEST-EDGE.e: native nextest port of upstream's
testsuite/daemon-gzip-download.test and daemon-gzip-upload.test, which
exercise the -zz (zlibx) per-block codec over a daemon transfer in both
directions. Asserts byte-identical round-trip, intact goodbye envelope
(no UTS-9 'connection unexpectedly closed' signature past the ~615KB
cutoff), and codec-engaged evidence via --stats. Adds a -z vs -zz
negotiation pin so silent codec collapse trips a regression.

Companion to PRs #5520, #5600, #5619 and the UTS-V3 cluster A drain;
the upstream tests run under continue-on-error in CI, so this nextest
port runs as a required check on every PR.
oferchen added a commit that referenced this pull request Jun 19, 2026
* test(uts): port daemon-gzip download/upload -zz to nextest

UTS-NEXTEST-EDGE.e: native nextest port of upstream's
testsuite/daemon-gzip-download.test and daemon-gzip-upload.test, which
exercise the -zz (zlibx) per-block codec over a daemon transfer in both
directions. Asserts byte-identical round-trip, intact goodbye envelope
(no UTS-9 'connection unexpectedly closed' signature past the ~615KB
cutoff), and codec-engaged evidence via --stats. Adds a -z vs -zz
negotiation pin so silent codec collapse trips a regression.

Companion to PRs #5520, #5600, #5619 and the UTS-V3 cluster A drain;
the upstream tests run under continue-on-error in CI, so this nextest
port runs as a required check on every PR.

* test: fix doc-lazy-continuation lint in daemon-gzip-zz module doc

Reword 'capability advertise + compress' to 'capability advertise and compress'
so clippy doesn't parse the wrapped '+' as a markdown list marker.
oferchen added a commit that referenced this pull request Jun 19, 2026
Adds the cross-binary upstream-compat harness primitives specified by
NXT-1 (`UpstreamVersion`, `locate_upstream_rsync`, `require_upstream_rsync`,
`upstream_compat_enabled`) and ports the upstream `daemon-gzip-download.test`
goodbye-flush invariant into nextest.

The test pairs an upstream rsync 3.4.4 client against an oc-rsync daemon
over TCP and pulls a ~1 MB `-zz`-compressed fixture sized to clear the
UTS-9 ~615 KB cutoff. The invariant pinned is that the daemon-sender
goodbye envelope reaches the upstream client without a premature
connection drop - the regression family fixed by PRs #5520 / #5600 /
#5619 / #5725.

Self-skips on three conditions: `OC_RSYNC_UPSTREAM_COMPAT` env var
unset (default for PR cells), upstream rsync 3.4.4 binary not present
at `target/interop/upstream-install/3.4.4/bin/rsync`, or the oc-rsync
binary cannot be located. Wall-time impact on the standard PR cell is
a single early-return.

NXT-1 calls out that the new `upstream-compat` CI cell is the wire-up
step that flips the env var on. That cell does not exist yet; this PR
ships the test and harness only, and a follow-up will add the matrix
entry to the existing nextest workflow.

Refs: docs/design/nxt-1-nextest-harness.md
oferchen added a commit that referenced this pull request Jun 19, 2026
…6002)

Adds the cross-binary upstream-compat harness primitives specified by
NXT-1 (`UpstreamVersion`, `locate_upstream_rsync`, `require_upstream_rsync`,
`upstream_compat_enabled`) and ports the upstream `daemon-gzip-download.test`
goodbye-flush invariant into nextest.

The test pairs an upstream rsync 3.4.4 client against an oc-rsync daemon
over TCP and pulls a ~1 MB `-zz`-compressed fixture sized to clear the
UTS-9 ~615 KB cutoff. The invariant pinned is that the daemon-sender
goodbye envelope reaches the upstream client without a premature
connection drop - the regression family fixed by PRs #5520 / #5600 /
#5619 / #5725.

Self-skips on three conditions: `OC_RSYNC_UPSTREAM_COMPAT` env var
unset (default for PR cells), upstream rsync 3.4.4 binary not present
at `target/interop/upstream-install/3.4.4/bin/rsync`, or the oc-rsync
binary cannot be located. Wall-time impact on the standard PR cell is
a single early-return.

NXT-1 calls out that the new `upstream-compat` CI cell is the wire-up
step that flips the env var on. That cell does not exist yet; this PR
ships the test and harness only, and a follow-up will add the matrix
entry to the existing nextest workflow.

Refs: docs/design/nxt-1-nextest-harness.md
oferchen added a commit that referenced this pull request Aug 24, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root
cause rather than by Stream bucket. Seven clusters surface; the parser-
stores-string and field-vs-method shadowing clusters cover the largest
share of the series, and the receiver-driver wiring-parity gap explains
the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a
defense-in-depth audit mapping each cluster onto the rust-landlock
ruleset wired at crates/fast_io/src/landlock.rs.

Doc-only; no code paths touched.
oferchen added a commit that referenced this pull request Aug 24, 2026
…path (#5520)

* fix: forward --stats into daemon, drain Sync flush, normalize delete path

Three independent fixes shake out interop failures from upstream rsync
3.4.3's testsuite that exercise daemon-side wire format on the receiver:

- daemon-delete-stats (UTS-6): the daemon never set `do_stats` from the
  client's `--stats` flag, so the generator skipped emitting
  `NDX_DEL_STATS` during the goodbye phase and the sender's stats
  showed "Number of deleted files: 0". Wire `--stats` into both the
  daemon's long-form arg parser and the server-mode flag parser.

- daemon-delete-stats (UTS-6): `delete_extraneous_files()` formed the
  filter check and itemize path as `dir_relative.join(name)`, which at
  the deletion root produced `./<name>`. A daemon-side `exclude = ?`
  rule then matched the `.` as a single-character directory component
  (via the descendant matcher `?/**`), suppressing legitimate top-level
  deletes. Strip the implicit `.` prefix when `dir_relative == "."`.

- compress-zlib-insert (UTS-18): `ZlibTokenEncoder::see_token()` called
  `compress(..., Z_SYNC_FLUSH)` exactly once per 0xFFFF chunk. A 64 KiB
  incompressible matched-block insert emits stored-block output >
  `compress_buf` (CHUNK_SIZE * 2), leaving residue inside the deflate
  state. The next literal write picks up the trapped output and
  desynchronises the stream, matching upstream rsync's issue #951.
  Loop the Sync flush, discarding output until the chunk is consumed
  and the compressor partially fills the buffer (signalling no more
  pending output).

Regression tests cover the daemon-side filter behaviour, the
single-char-glob deletion case, and the large incompressible insert.

* style: cargo fmt fix

* fix: drop shadowed PathBuf import from deletion module

* style: regroup hex literal digits to satisfy clippy
oferchen added a commit that referenced this pull request Aug 24, 2026
* test(uts): port daemon-gzip download/upload -zz to nextest

UTS-NEXTEST-EDGE.e: native nextest port of upstream's
testsuite/daemon-gzip-download.test and daemon-gzip-upload.test, which
exercise the -zz (zlibx) per-block codec over a daemon transfer in both
directions. Asserts byte-identical round-trip, intact goodbye envelope
(no UTS-9 'connection unexpectedly closed' signature past the ~615KB
cutoff), and codec-engaged evidence via --stats. Adds a -z vs -zz
negotiation pin so silent codec collapse trips a regression.

Companion to PRs #5520, #5600, #5619 and the UTS-V3 cluster A drain;
the upstream tests run under continue-on-error in CI, so this nextest
port runs as a required check on every PR.

* test: fix doc-lazy-continuation lint in daemon-gzip-zz module doc

Reword 'capability advertise + compress' to 'capability advertise and compress'
so clippy doesn't parse the wrapped '+' as a markdown list marker.
oferchen added a commit that referenced this pull request Aug 24, 2026
…6002)

Adds the cross-binary upstream-compat harness primitives specified by
NXT-1 (`UpstreamVersion`, `locate_upstream_rsync`, `require_upstream_rsync`,
`upstream_compat_enabled`) and ports the upstream `daemon-gzip-download.test`
goodbye-flush invariant into nextest.

The test pairs an upstream rsync 3.4.4 client against an oc-rsync daemon
over TCP and pulls a ~1 MB `-zz`-compressed fixture sized to clear the
UTS-9 ~615 KB cutoff. The invariant pinned is that the daemon-sender
goodbye envelope reaches the upstream client without a premature
connection drop - the regression family fixed by PRs #5520 / #5600 /
#5619 / #5725.

Self-skips on three conditions: `OC_RSYNC_UPSTREAM_COMPAT` env var
unset (default for PR cells), upstream rsync 3.4.4 binary not present
at `target/interop/upstream-install/3.4.4/bin/rsync`, or the oc-rsync
binary cannot be located. Wall-time impact on the standard PR cell is
a single early-return.

NXT-1 calls out that the new `upstream-compat` CI cell is the wire-up
step that flips the env var on. That cell does not exist yet; this PR
ships the test and harness only, and a follow-up will add the matrix
entry to the existing nextest workflow.

Refs: docs/design/nxt-1-nextest-harness.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant