Skip to content

generator: add a logical file transfer budget - #1022

Merged
steadytao merged 15 commits into
RsyncProject:masterfrom
chamilton-ccn:data-transfer-limit
Dec 4, 2026
Merged

steadytao merged 15 commits into
RsyncProject:masterfrom
chamilton-ccn:data-transfer-limit

Conversation

@chamilton-ccn

@chamilton-ccn chamilton-ccn commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add --file-transfer-budget=SIZE for local copies. Count the logical lengths of regular files admitted for transfer. Stop before the first file that does not fit, finish admitted work and return status 23. Leave later entries untouched. Deletion, remote transfers and deliberate overshoot are not supported.

chamilton-ccn and others added 9 commits June 1, 2026 16:33
…-transfer-limit-check`. The former sets a limit on the amount of data to be transferred (does not account for delta transfer), and the latter allows the limit to be exceeded in cases where the limit has not yet been reached, but the next file will exceed it. For example, if the limit is 100MiB and 99MiB have transferred, and the next file is 10MiB, the delay parameter will allow that file to be transferred. In this example, without the delay parameter, rsync will stop at 99MiB.

@steadytao steadytao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a useful feature request but I think it needs a careful design pass before it is merge-ready. It adds global transfer-limit state, a new multiplex message, new exit-code behaviour and file-list/generator control-flow changes so the important questions are protocol compatibility, sender/receiver agreement and what exactly counts as transferred data.

A few things I would want clarified before deeper review:

  • Is MSG_DATA_LIMIT_REACHED safe with older protocol peers or does it need protocol-version/capability gating?
  • Should the limit count source file length, actual bytes written, matched-data bytes or only whole-file transfer candidates?
  • What should happen with hard-linked files where a later path may not transfer data but still creates an entry?
  • Should delete phases still run after the transfer limit is reached?
  • The //CEH3 markers and generated configure churn should probably be cleaned up before review.

I would suggest adding a short protocol/semantics note to the PR description and possibly splitting the generated-file refresh from the functional change.

@chamilton-ccn

chamilton-ccn commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor Author

@steadytao Thank you! I'm looking into all of this and I'll reply back when I have a more thorough response.

The //CEH3 markers and generated configure churn should probably be cleaned up before review.

Yeah -- I did remove those in a later commit; sorry about that! I'll squash all of this in a subsequent commit.

Thanks again!

@steadytao steadytao added the Enhancement New capability or intentional behaviour change label Jul 16, 2026
@chamilton-ccn

chamilton-ccn commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor Author

It's going to take me some time to answer each of these questions. I'll add updates as I'm able.

Is MSG_DATA_LIMIT_REACHED safe with older protocol peers or does it need protocol-version/capability gating?

I know compatibility gating is needed for the new parameters. Here's a quick example:

rsync -avv --data-transfer-limit 13M ./TEST/ user@remotehost:TEST/
opening connection using: ssh remotehost rsync --server -vvlogDtpre.iLsfxCIvu --data-transfer-limit=13M . TEST/  (8 args)
rsync: on remote machine: --data-transfer-limit=13M: unknown option
rsync error: syntax or usage error (code 1) at main.c(1817) [server=3.2.7]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(233) [sender=3.5.0dev]

As for the implementation, I'm still figuring that out.

Should the limit count source file length, actual bytes written, matched-data bytes or only whole-file transfer candidates?

At first I thought that it would be ideal for the user to specify this via another command line parameter, but then I tried to come up with scenarios where anyone would be interested in anything other than actual bytes written/transferred and concluded that this is almost certainly the only metric that matters in most cases. So I'll work on impementing that.

EDIT: This is going to require a protocol version bump.

@steadytao

Copy link
Copy Markdown
Member

Just want to say thank you for your work!

@chamilton-ccn

Copy link
Copy Markdown
Contributor Author

Just want to say thank you for your work!

I'm more than happy to contribute!

@steadytao steadytao changed the title Specifying a limit for total data transfer generator: add a logical file transfer budget Nov 26, 2026
@steadytao steadytao added this to the 4.0.0 milestone Nov 26, 2026
@chamilton-ccn

Copy link
Copy Markdown
Contributor Author

@steadytao Apologies for the apparent abandonment of this PR! I simply haven't had the time to resume further development of this feature, but I'm excited to see that it's now a milestone for v4.0.0. Thanks for all of your work supporting the rsync project!

@steadytao

Copy link
Copy Markdown
Member

@steadytao Apologies for the apparent abandonment of this PR! I simply haven't had the time to resume further development of this feature, but I'm excited to see that it's now a milestone for v4.0.0. Thanks for all of your work supporting the rsync project!

No worries at all. Thank you for your original work.

@steadytao
steadytao merged commit 305e73b into RsyncProject:master Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New capability or intentional behaviour change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants