Skip to content
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

Use the same code path for local and remote syncs #572

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tleedjarv
Copy link
Contributor

This came out of the discussion at #571.

Closes #570

It is my third iteration. The first iteration was very similar to this, just more hackish and with more changes in Remote. For second iteration, I wanted to make the Remote module simpler (could drop the registerRootCmdWithConnection function completely) but unfortunately that's not possible. It would mean the signatures of remote functions in Copy would have to change and that would break compatibility with 2.51. This third iteration is fully compatible with 2.51.

The code path taken by local and remote syncs is now the same. Maybe there are some optimizations that make sense locally (for example, bigger buffers? then again, all buffers are currently quite small so this question does not have to come in here). This PR does not look at that side of things at all.

I have done some very brief testing locally and remotely with ssh and socket server and also with 2.51.

(As draft so it doesn't get accidentally merged. The change itself is finished as of now.)

@gdt gdt changed the title Use the same code path for local and remote syncs RFC: Use the same code path for local and remote syncs Feb 17, 2022
@gdt gdt added the DRAFT PR is not ready to merge label Feb 17, 2022
@gdt gdt changed the title RFC: Use the same code path for local and remote syncs Use the same code path for local and remote syncs Feb 17, 2022
In the Copy module, local syncs do a direct copy and that's it. Remote
syncs meanwhile check for already transferred files, check for partially
transferred resumable files, can use the rsync algorithm and an external
copyprog.

Make local and remote syncs use the same code path. The functionality
for both cases is now the same, but since the code was optimized for the
remote case then there could be some optimization opportunities for
local syncs. This is something this patch does not include.
@tleedjarv
Copy link
Contributor Author

Rebased after more than 2 years. Having thought about it some more, I'm not convinced this is the right way to go. At least not without having some exceptions for the local sync anyway. Otherwise it can introduce more IO than what's done currently for local syncs (and remember: "local" can mean that sync happens on a network mount, which could even be a WAN, not just LAN). But the code is here for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRAFT PR is not ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local sync does not resume partial transfer
2 participants