Repository navigation
fix: echo NDX_DEL_STATS back from a server sender - #8112
Merged
Merged
Conversation
In a pull the client's generator does the deleting and sends its counters to the sender as NDX_DEL_STATS. Upstream's server sender writes them straight back (rsync.c:339-341, am_sender && am_server) so the client's receiver can report them. oc's sender only folded them into its own counters, so an rsync client pulling from an oc server printed "Number of deleted files: 0" however many it removed. Echo the frame where it is read in the transfer loop (delete during or before), and from the goodbye read (delete after or delay) ahead of the sender's goodbye NDX_DONE. A client sender never echoes.
oferchen
enabled auto-merge (squash)
October 6, 2026 20:28
The receiver sent its deletion counters in the goodbye, one NDX_DONE after the one that ends the sender phase loop. Upstream sends them earlier (generator.c:2867-2871 early, 2911-2915 late), so a server sender reads them in send_files() and echoes them before its stats (rsync.c:338-341). With the late frame an oc server sender echoed after the stats trailer, which broke the pull byte-neutrality masker. Emit the frame at the phase boundary upstream uses: before the third phase NDX_DONE, or before the second for an early delete under --delay-updates. Drop the 8 delete pull/oc-server expect rows that now pass.
…cho-del-stats # Conflicts: # tools/ci/interop_oracle_expect.txt
oferchen
disabled auto-merge
October 7, 2026 16:06
mevanlc
pushed a commit
to mevanlc/rsync-rs
that referenced
this pull request
Oct 14, 2026
* fix: echo NDX_DEL_STATS back from a server sender In a pull the client's generator does the deleting and sends its counters to the sender as NDX_DEL_STATS. Upstream's server sender writes them straight back (rsync.c:339-341, am_sender && am_server) so the client's receiver can report them. oc's sender only folded them into its own counters, so an rsync client pulling from an oc server printed "Number of deleted files: 0" however many it removed. Echo the frame where it is read in the transfer loop (delete during or before), and from the goodbye read (delete after or delay) ahead of the sender's goodbye NDX_DONE. A client sender never echoes. * fix: send NDX_DEL_STATS ahead of the last phase NDX_DONE The receiver sent its deletion counters in the goodbye, one NDX_DONE after the one that ends the sender phase loop. Upstream sends them earlier (generator.c:2867-2871 early, 2911-2915 late), so a server sender reads them in send_files() and echoes them before its stats (rsync.c:338-341). With the late frame an oc server sender echoed after the stats trailer, which broke the pull byte-neutrality masker. Emit the frame at the phase boundary upstream uses: before the third phase NDX_DONE, or before the second for an early delete under --delay-updates. Drop the 8 delete pull/oc-server expect rows that now pass.
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
In a pull, the client's generator does the deleting and sends its counters to the sender as NDX_DEL_STATS. Upstream's server sender writes them straight back (
rsync.c:339-341,am_sender && am_server) so the client's receiver can report them. oc's sender only added them to its own counters. As a result, an rsync client pulling from an oc server printed "Number of deleted files: 0" no matter how many files it removed.The frame is now echoed back:
A client sender never echoes.
Test plan
pull --delete --statsfrom an oc server sender reports "Number of deleted files: 2".