Skip to content

fix: echo NDX_DEL_STATS back from a server sender - #8112

Merged
oferchen merged 4 commits into
masterfrom
fix/server-sender-echo-del-stats
Oct 7, 2026
Merged

oferchen merged 4 commits into
masterfrom
fix/server-sender-echo-del-stats

Conversation

@oferchen

@oferchen oferchen commented Oct 6, 2026

Copy link
Copy Markdown
Owner

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:

  • in the transfer loop, where it is read (delete-during and delete-before);
  • in the goodbye read, ahead of the sender's goodbye NDX_DONE (delete-after and delete-delay).

A client sender never echoes.

Test plan

  • e2e: pull --delete --stats from an oc server sender reports "Number of deleted files: 2".

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
oferchen enabled auto-merge (squash) October 6, 2026 20:28
@github-actions github-actions Bot added the bug Something isn't working label Oct 6, 2026
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
oferchen disabled auto-merge October 7, 2026 16:06
@oferchen
oferchen merged commit 20c8043 into master Oct 7, 2026
62 of 77 checks passed
@oferchen
oferchen deleted the fix/server-sender-echo-del-stats branch 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.
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