Skip to content

feat: add MSG_REDO wire protocol support for redo phase signaling - #2529

Merged
oferchen merged 1 commit into
masterfrom
feat/redo-phase-signaling
Feb 27, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/redo-phase-signaling

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add MSG_REDO (code 45) handling in MultiplexReader to accumulate file indices from receiver-side checksum failures, following the same pattern as existing MSG_NO_SEND support
  • Add send_redo(ndx) to ServerWriter for sending MSG_REDO messages over the multiplexed channel
  • Add drain_new_redo_indices() to PipelinedReceiver for non-disabling drain during pipeline loop

Upstream Reference

  • receiver.c:970-974 — receiver sends send_msg_int(MSG_REDO, ndx) on whole-file checksum failure
  • io.c:1514-1519 — generator-side MSG_REDO handler queues index to redo_list

Test plan

  • 9 new tests: MSG_REDO accumulation, invalid payload rejection, interleaved MSG_REDO + MSG_NO_SEND, ServerReader delegation, ServerWriter send_redo
  • All 1005 transfer crate tests pass
  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings clean

Add MSG_REDO handling in the multiplexed reader, writer, and pipeline
receiver to support upstream rsync's redo phase signaling protocol.

- MultiplexReader: accumulate MSG_REDO file indices (4-byte LE i32)
  during reads, matching the MSG_NO_SEND accumulation pattern
  (upstream: io.c:1514-1519)
- ServerReader: delegate take_redo_indices() to inner reader variants
- ServerWriter: add send_redo(ndx) for sending MSG_REDO messages
  (upstream: receiver.c:970-974)
- PipelinedReceiver: add drain_new_redo_indices() for non-disabling
  drain during pipeline loop (preserves redo mode for continued
  collection)
- Handle MSG_REDO in both try_borrow_exact and read match arms

Tests: 9 new tests covering accumulation, invalid payload rejection,
interleaved MSG_REDO + MSG_NO_SEND, ServerReader delegation, and
ServerWriter send_redo in both multiplex and plain modes.
@oferchen
oferchen force-pushed the feat/redo-phase-signaling branch from 4ee5e9b to caa4687 Compare February 27, 2026 14:48
@oferchen
oferchen merged commit d5893b7 into master Feb 27, 2026
7 checks passed
@github-actions github-actions Bot added the enhancement New feature or request label Feb 27, 2026
@oferchen
oferchen deleted the feat/redo-phase-signaling branch February 27, 2026 14:50
oferchen added a commit that referenced this pull request May 1, 2026
)

Add MSG_REDO handling in the multiplexed reader, writer, and pipeline
receiver to support upstream rsync's redo phase signaling protocol.

- MultiplexReader: accumulate MSG_REDO file indices (4-byte LE i32)
  during reads, matching the MSG_NO_SEND accumulation pattern
  (upstream: io.c:1514-1519)
- ServerReader: delegate take_redo_indices() to inner reader variants
- ServerWriter: add send_redo(ndx) for sending MSG_REDO messages
  (upstream: receiver.c:970-974)
- PipelinedReceiver: add drain_new_redo_indices() for non-disabling
  drain during pipeline loop (preserves redo mode for continued
  collection)
- Handle MSG_REDO in both try_borrow_exact and read match arms

Tests: 9 new tests covering accumulation, invalid payload rejection,
interleaved MSG_REDO + MSG_NO_SEND, ServerReader delegation, and
ServerWriter send_redo in both multiplex and plain modes.
oferchen added a commit that referenced this pull request May 5, 2026
)

Add MSG_REDO handling in the multiplexed reader, writer, and pipeline
receiver to support upstream rsync's redo phase signaling protocol.

- MultiplexReader: accumulate MSG_REDO file indices (4-byte LE i32)
  during reads, matching the MSG_NO_SEND accumulation pattern
  (upstream: io.c:1514-1519)
- ServerReader: delegate take_redo_indices() to inner reader variants
- ServerWriter: add send_redo(ndx) for sending MSG_REDO messages
  (upstream: receiver.c:970-974)
- PipelinedReceiver: add drain_new_redo_indices() for non-disabling
  drain during pipeline loop (preserves redo mode for continued
  collection)
- Handle MSG_REDO in both try_borrow_exact and read match arms

Tests: 9 new tests covering accumulation, invalid payload rejection,
interleaved MSG_REDO + MSG_NO_SEND, ServerReader delegation, and
ServerWriter send_redo in both multiplex and plain modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant