Skip to content

fix: emit NDX_DEL_STATS without --stats gate (URV-6.a) - #5543

Merged
oferchen merged 1 commit into
masterfrom
fix/urv-6a-ndx-del-stats-gate
Jun 10, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/urv-6a-ndx-del-stats-gate

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Align should_send_del_stats() with upstream rsync 3.4.4 by removing the INFO_GTE(STATS, 2) (--stats / do_stats) gate on NDX_DEL_STATS emission during the goodbye phase.
  • Match upstream generator.c:2393-2398 (early del_stats path) and generator.c:2437-2442 (late del_stats path), both of which dropped the INFO_GTE(STATS, 2) requirement in 3.4.4 and now gate solely on delete_mode || force_delete || read_batch.
  • Verified supports_extended_goodbye() already returns >= 31, matching upstream's protocol_version >= 31 guard - no change required to the protocol gate.

Background

Pre-3.4.4 upstream gated NDX_DEL_STATS on INFO_GTE(STATS, 2). In 3.4.4 that gate was deliberately removed: deletion statistics are now emitted whenever deletion is active, independent of whether the user passed --stats. oc-rsync's previous gate (do_stats && flags.delete early / do_stats late) silently dropped NDX_DEL_STATS in the common case, breaking wire-level conformance with 3.4.4 and leaving the sender-side accumulator at zero.

Scope notes

  • oc-rsync's transfer config does not track force_delete or read_batch as distinct fields. The new gate uses flags.delete to cover the delete_mode case; wiring up the other two branches is left as follow-up once the corresponding config plumbing exists.
  • Receiver-side NDX_DEL_STATS handling in crates/transfer/src/receiver/transfer/phases.rs was already permissive (loops past NDX_DEL_STATS), so no receiver changes are required.
  • Reference: URV-6 upstream 3.4.4 conformance audit at docs/audits/upstream-3.4.4-conformance.md.

Test plan

  • Existing should_send_del_stats tests restructured to drop the do_stats=true precondition.
  • New regression del_stats_sent_without_do_stats_when_deleting asserts emission proceeds with --stats off (early path).
  • New regression del_stats_late_sent_without_do_stats asserts the same on the late path.
  • Retained del_stats_not_sent_when_no_delete and del_stats_late_not_sent_without_delete to confirm the predicate still skips emission when deletion is inactive.
  • CI: fmt+clippy, nextest (stable), Windows, macOS, Linux musl.

Align `should_send_del_stats()` with upstream rsync 3.4.4: the
`INFO_GTE(STATS, 2)` (`--stats`) requirement was removed in 3.4.4, so
deletion statistics are now emitted during the goodbye phase whenever
deletion is active, regardless of whether the user passed `--stats`.

Previously the generator gated emission on `do_stats && flags.delete`
(early) or `do_stats` alone (late), causing the sender to skip
NDX_DEL_STATS in the common case where deletion is requested but stats
output is not. This left the receiver's accumulated deletion counters
permanently zero in transcripts and broke wire-level conformance with
upstream 3.4.4.

The new gate matches upstream:
- Early path (generator.c:2393-2398): delete_mode || force_delete
  || read_batch
- Late  path (generator.c:2437-2442): delete_mode || force_delete
  || read_batch

oc-rsync does not yet track `force_delete` or `read_batch` as distinct
fields in the transfer config; this change uses `flags.delete` to cover
the `delete_mode` case and leaves the other two branches for follow-up
once the corresponding plumbing exists. The protocol gate
`supports_extended_goodbye()` was already correctly set to `>= 31`
(matching upstream's `protocol_version >= 31` guard), so no change is
needed there.

Tests are restructured to drop the `do_stats=true` precondition and add
two new cases asserting emission proceeds with `--stats` off, covering
both early and late deletion timing.
@github-actions github-actions Bot added the bug Something isn't working label Jun 10, 2026
@oferchen
oferchen merged commit 1d6d218 into master Jun 10, 2026
68 checks passed
@oferchen
oferchen deleted the fix/urv-6a-ndx-del-stats-gate branch June 10, 2026 09:30
oferchen added a commit that referenced this pull request Aug 24, 2026
Align `should_send_del_stats()` with upstream rsync 3.4.4: the
`INFO_GTE(STATS, 2)` (`--stats`) requirement was removed in 3.4.4, so
deletion statistics are now emitted during the goodbye phase whenever
deletion is active, regardless of whether the user passed `--stats`.

Previously the generator gated emission on `do_stats && flags.delete`
(early) or `do_stats` alone (late), causing the sender to skip
NDX_DEL_STATS in the common case where deletion is requested but stats
output is not. This left the receiver's accumulated deletion counters
permanently zero in transcripts and broke wire-level conformance with
upstream 3.4.4.

The new gate matches upstream:
- Early path (generator.c:2393-2398): delete_mode || force_delete
  || read_batch
- Late  path (generator.c:2437-2442): delete_mode || force_delete
  || read_batch

oc-rsync does not yet track `force_delete` or `read_batch` as distinct
fields in the transfer config; this change uses `flags.delete` to cover
the `delete_mode` case and leaves the other two branches for follow-up
once the corresponding plumbing exists. The protocol gate
`supports_extended_goodbye()` was already correctly set to `>= 31`
(matching upstream's `protocol_version >= 31` guard), so no change is
needed there.

Tests are restructured to drop the `do_stats=true` precondition and add
two new cases asserting emission proceeds with `--stats` off, covering
both early and late deletion timing.
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