Repository navigation
generator: add a logical file transfer budget - #1022
Conversation
…-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.
…it-check_test.py` for clarification.
…ta-transfer-limit branch
steadytao
left a comment
There was a problem hiding this comment.
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_REACHEDsafe 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
//CEH3markers and generatedconfigurechurn 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.
|
@steadytao Thank you! I'm looking into all of this and I'll reply back when I have a more thorough response.
Yeah -- I did remove those in a later commit; sorry about that! I'll squash all of this in a subsequent commit. Thanks again! |
|
It's going to take me some time to answer each of these questions. I'll add updates as I'm able.
I know compatibility gating is needed for the new parameters. Here's a quick example: As for the implementation, I'm still figuring that out.
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. |
|
Just want to say thank you for your work! |
I'm more than happy to contribute! |
|
@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. |
Summary
Add
--file-transfer-budget=SIZEfor 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.