Repository navigation
fix: emit NDX_DEL_STATS without --stats gate (URV-6.a) - #5543
Merged
Merged
Conversation
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.
This was referenced Jun 10, 2026
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.
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
should_send_del_stats()with upstream rsync 3.4.4 by removing theINFO_GTE(STATS, 2)(--stats/do_stats) gate on NDX_DEL_STATS emission during the goodbye phase.generator.c:2393-2398(early del_stats path) andgenerator.c:2437-2442(late del_stats path), both of which dropped theINFO_GTE(STATS, 2)requirement in 3.4.4 and now gate solely ondelete_mode || force_delete || read_batch.supports_extended_goodbye()already returns>= 31, matching upstream'sprotocol_version >= 31guard - 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.deleteearly /do_statslate) 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
force_deleteorread_batchas distinct fields. The new gate usesflags.deleteto cover thedelete_modecase; wiring up the other two branches is left as follow-up once the corresponding config plumbing exists.crates/transfer/src/receiver/transfer/phases.rswas already permissive (loops past NDX_DEL_STATS), so no receiver changes are required.docs/audits/upstream-3.4.4-conformance.md.Test plan
should_send_del_statstests restructured to drop thedo_stats=trueprecondition.del_stats_sent_without_do_stats_when_deletingasserts emission proceeds with--statsoff (early path).del_stats_late_sent_without_do_statsasserts the same on the late path.del_stats_not_sent_when_no_deleteanddel_stats_late_not_sent_without_deleteto confirm the predicate still skips emission when deletion is inactive.