Skip to content

Add continuous transfer mode #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add continuous transfer mode #17

wants to merge 2 commits into from

Conversation

ig11987
Copy link
Contributor

@ig11987 ig11987 commented May 23, 2025

Closes: #16

@ig11987 ig11987 changed the title Draft: Add incremtntal transfer Draft: Add incremental transfer May 23, 2025
@ig11987 ig11987 force-pushed the 16-differential branch 8 times, most recently from 77988c7 to 8d1505c Compare May 24, 2025 13:29
@ig11987 ig11987 force-pushed the 16-differential branch 3 times, most recently from 085add4 to 589871c Compare May 24, 2025 21:05
@ig11987 ig11987 marked this pull request as ready for review May 24, 2025 21:05
@ig11987 ig11987 changed the title Draft: Add incremental transfer Add incremental transfer May 24, 2025
@ig11987 ig11987 force-pushed the 16-differential branch from 589871c to 6fd174f Compare May 24, 2025 21:13
@ig11987 ig11987 requested a review from ruuda May 26, 2025 10:06
@ruuda
Copy link
Contributor

ruuda commented May 26, 2025

Ooh, nice! I didn’t review in depth yet, but one thing that comes to mind, our goal for this is to sync a directory, where the sending side may still be producing new files, right? So we sync once, but by the time it’s complete, there may be new files, so we do it again, etc., until the difference is very small, then we stop the process that’s writing files, we do a final sync, and at that point we know the copy is complete.

With the current implementation, would we need to execute fastsync for multiple iterations? Because if this is the goal anyway, and if the receiver and sender negotiate anyway, then maybe it makes sense to build that loop right into fastsync itself, and make the protocol more interactive. After the sender sends its last piece, it could re-scan its input files to see if any of them changed, and if so go for a new round. Not sure if that would be a major complication though. What do you think? I don’t mean to scope-creep things, we can also leave it for a later version, but if it’s a few-line modification I think that could improve the practical usability a lot.

@ig11987 ig11987 force-pushed the 16-differential branch from 6fd174f to f449afc Compare May 27, 2025 00:37
@ig11987
Copy link
Contributor Author

ig11987 commented May 27, 2025

With the current implementation, would we need to execute fastsync for multiple iterations?

In my use-case it's 2 times.
a: fastsync without incremental (target directory is empty, so does not matter if it gets deleted before accepting packages - current behavior). (1)
b: Then stop the workload that produces the files that are transferring
c: Sync with incremental for any leftover files. (2)

So we sync once, but by the time it’s complete, there may be new files, so we do it again, etc., until the difference is very small, then we stop the process that’s writing files, we do a final sync, and at that point we know the copy is complete.

The transfer is usually much faster than the speed of producing files, so I have not observed this being very useful for the workloads I have worked with so far.
But I do see the potential of continuous mode being useful.

There is are some potential risks:

  1. the process never ending - we can offload this to the user
  2. how to deal with deletes on sender (I don't think it's currently handled) - could produce many files piling up on the receiver.
  3. the code becoming too complicated for the added utility when compared to incremental.

but if it’s a few-line modification I think that could improve the practical usability a lot.

Yes, considering we would not keep the incremental (one-time continuous) mode, the changes (wip) compared to the current PR would not be too much.
Allow me some further time to properly test this use-case and implementation.

Edit: this is now done and tested.

@ig11987 ig11987 force-pushed the 16-differential branch from 0467bcd to a9fc92a Compare May 28, 2025 19:40
@ig11987 ig11987 marked this pull request as draft May 28, 2025 19:40
@ig11987 ig11987 force-pushed the 16-differential branch 6 times, most recently from 84969ff to 67b7bbe Compare May 28, 2025 22:06
@ig11987 ig11987 changed the title Add incremental transfer Add continuous transfer mode May 28, 2025
@ig11987 ig11987 force-pushed the 16-differential branch from 67b7bbe to 1c320a9 Compare May 28, 2025 22:19
@ig11987 ig11987 marked this pull request as ready for review May 28, 2025 22:19
@ig11987 ig11987 requested a review from patrickjeremic May 29, 2025 11:37
@ig11987 ig11987 force-pushed the 16-differential branch from 1c320a9 to ed0ec5a Compare May 31, 2025 14:25
@ig11987 ig11987 marked this pull request as draft June 3, 2025 15:34
@ig11987 ig11987 force-pushed the 16-differential branch 8 times, most recently from d9a1c4e to 737e2db Compare June 5, 2025 14:33
@ig11987 ig11987 force-pushed the 16-differential branch from 737e2db to 716c0e8 Compare June 5, 2025 16:18
@ig11987 ig11987 marked this pull request as ready for review June 14, 2025 00:06
@@ -0,0 +1,289 @@
#!/bin/bash
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know about this script, it felt nice to have it during development to validate the integration, but I think it's too time sensitive and unreliable to put into CI.
But if it's not in CI it will get broken over time probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Differential (incremental) transfer
2 participants