You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It relates to the remote-delta implementation on client. But I suppose it must be supported on both sides. I saw that latest version of csync inludes a module for owncloud but it differs on current implementation of client on github.
in fact I saw that's using a special module that's not on the normal csync library that's called httpbf. It seems for me that's sending the whole file as PUT http?
So my question is. If you will want to implement rsync how will you implement it?
I was thinking about clone a module on csync and make it transfer using remote-delta (surely using rsync lib) instead of sending the whole file in chunks.
What do you think? Any suggestions?
Using httpbf. I can detect what's changed and send only the blocks that are changed. But this would mean extra work for nothing. Because librsync already implements this kind of processing we are not going to do ti twice.
Best regards,
Reacted by Fabian Beier-Trampusch, haarp and Devin Bayer
Hi @gadLinux , thank you for trying to help on this issue.
The client is no longer using httpf. And is using only very few parts of csync.
You need to contribute in the client repository. (and in the core)
You will find the code that uploads files in src/libsync/propagateupload.cpp here you will find the code that split the file in chunks and uploads them.
Similarily, the code that download the files is in src/libsync/propagatedownload.cpp (this is not using chunks)
Good luck :-)
But be warned that i think it is a difficult issue. I don't really know if it is possible to do that on top of webdav so you will probably need some kind of extensions to the protocol.
There needs to be a list of blocks with its according checksums stored on the server for every file. It will be accessible through a special route on the server API.
The client will need to fetch the list once it detected that an existing file has changed and is to be uploaded. Once the blocklist has arrived, the client needs to recalculate the blocklist on the new, changed file. After that, the client can compare the lists and identify the blocks that have a changed checksum. These are the blocks that need to be uploaded.
To upload only parts of files, maybe the HTTP PATCH command (RFC) helps. The server needs to be able to handle this command and reassemble the whole file.
For files that appear new on the client, the client will have to calculate the blocklist and send it along the initial upload to the server to avoid having the server to calculate the list. Also, for each uploaded block, the client will send the new checksum along. The server will either recalculate or invalidate the blocklist for files that were changed on third party storage.
The client needs to be able to deal with the fact that the server can not provide a blocklist for a file and will transparently fall back to uploading the entire file.
The kind of checksum is configurable, and will be adjustable by a server configuration later.
A good starting point for a rsync-like approach using HTTP is zsync, aka client-side rsync. I don't think using librsync is feasible, as we want to stick to HTTP(S) as transport protocol.
Thank you for the feedback. I will see what parts are in use on csync.
Because I have thinking about two approach. One is to implement the
rsync protocol to transfer the file, and the second one is use something
like bitttorrent. So it can transfer only the parts needed for it but
also leave doors open for multiple client sync against same file in a
decentralized way.
I suppose that the first way is easier and better for now.
Let me check the code.
What's the most recent branch of development in both projects? I found
there are many and many commits on each branch.
Best regards,
El 22/05/15 a las 12:20, Olivier Goffart escribió:
The client is no longer using httpf. And is using only very few parts
of csync.
You need to contribute in the client repository. (and in the core)
You will find the code that uploads files in
|src/libsync/propagateupload.cpp| here you will find the code that
split the file in chunks and uploads them.
Similarily, the code that download the files is in
|src/libsync/propagatedownload.cpp| (this is not using chunks)
Good luck :-)
But be warned that i think it is a difficult issue. I don't really
know if it is possible to do that on top of webdav so you will
probably need some kind of extensions to the protocol.
—
Reply to this email directly or view it on GitHub #16162 (comment).
@gadLinux Please stick with HTTP. Other protocols are not usable in certain scenarios (Port 80 and 443 are always open, others often are not). On top of that, another advantages with the HTTP-based zsync approach is that the server can remain mostly passive, which shifts a lot of load to the client. This improves scalability.
So it's important to reimplement solution over HTTP. Okay, I hope I can
do it this weekend or so.
Did you think about using thrift?
Best regards,
El 25/05/15 a las 11:40, Daniel Molkentin escribió:
@gadLinuxhttps://github.com/gadLinux Please stick with HTTP. Other
protocols are not usable in certain scenarios (Port 80 and 443 are
always open, others often are not). On top of that, there are a number
of other advantages with the zsync approach (with sits on top of
HTTP), is that the server can remain mostly passive, which shifts a
lot of load to the client. This improves scalability.
—
Reply to this email directly or view it on GitHub #16162 (comment).
It does not have to be HTTP, but it would be better. (The configuration of an owncloud server has to remain simple). Anyway if it doesn't work we can still fallback to the normal method.
Anyway, as I said, we are slowly moving away from csync, and new code on the client should be written in C++ in the libsync directory.
Bittorrent-like protocol would be something different, that opens its own cans of worms (how do you do authantication or security if you are peer to peer?)
and the second one is use something like bitttorrent. So it can transfer only the parts needed for it but also leave doors open for multiple client sync against same file in a decentralized way.
Do not try to solve two problems at once. The basic idea behind ownCloud is that the server stays in control of the data, so p2p would involve getting a server authorization first. This requires oauth, which is scheduled for one of the next ownCloud server versions. The p2p implementation would then be purely client-side, and not involve the server at all, except for the authorization request.
and the second one is use something like bitttorrent. So it can transfer
only the parts needed for it but also leave doors open for multiple
client sync against same file in a decentralized way.
Do not try to solve two problems at once. The basic idea behind
ownCloud is that the server stays in control of the data, so p2p would
involve getting a server authorization first. This requires oauth,
which is scheduled for one of the next ownCloud server versions. The
p2p implementation would then be purely client-side, and not involve
the server at all, except for the authorization request.
Yo are right, I agree. Let me take a look to the partial file sync problem.
Ok so I have been looking into this and reading up on zsync (and by extend rsync). And I think this is something that can be done. Luckily the zsync library is available so I'm modifying that to get a POC working. Since at least the upload use case is not what is was designed for.
I'll hopefully soon put that work on github. So stay tuned. But let me here (quickly) write down how I think this should work.
Assumptions
This only covers the upload scenario (download will follow later, but is easier since it is basically the part zsync tries to solve already)
The server has a copy of file F
The client has a modified copy of file F, lets call it F-new
The server already has the checksum file of F, let call it F-zsync
Setup
Server
The server has only 2 tasks. Store the -zsync files. And generate the new file. This is to keep things scalable and not have the server do all the checksumming.
We need to come up with a protocol to tell the server how to assemble the new file. I'll be thinking about that.
We do require space for this to work since you need to copy the original file. And only copy it back once everything is done. Probably locking is also a good idea.
Client
In the normal use case of zsync the client figures out which parts are needed from the server. Now we need to find the parts in common with the server. Which parts needs to go. And which parts need to be added. This requires some new code but the info should all be available.
Since the server is not doing much here all the computational load is shifted to the client. Also in the current setup we trust the clients to generate the zsync files (this is hell in PHP) and send them. From my point of view this is fine since any client can just do a PUT request now anyway.
I hope to have a POC (in C so easily portable to the client) soonish.
I think it should work this way both for the upload and the download because we already know which file is the "newer" one. The client calculates the parts which have to be transferred and the direction is then depending on the sync status.
For the upload there should be something like a HTTP PATCH request.
Looks great! Finally I didn't have time to go into deep. But if you fail
or need help please let me know.
Best regards,
El 30/06/15 a las 09:37, Roeland Douma escribió:
Ok so I have been looking into this and reading up on zsync (and by
extend rsync). And I think this is something that can be done. Luckily
the zsync library is available so I'm modifying that to get a POC
working. Since at least the upload use case is not what is was
designed for.
I'll hopefully soon put that work on github. So stay tuned. But let me
here (quickly) write down how I think this should work.
Assumptions
This only covers the upload scenario (download will follow later,
but is easier since it is basically the part zsync tries to solve
already)
The server has a copy of file F
The client has a modified copy of file F, lets call it F-new
The server already has the checksum file of F, let call it F-zsync
The server has only 2 tasks. Store the -zsync files. And generate the
new file. This is to keep things scalable and not have the server do
all the checksumming.
We need to come up with a protocol to tell the server how to assemble
the new file. I'll be thinking about that.
We do require space for this to work since you need to copy the
original file. And only copy it back once everything is done. Probably
locking is also a good idea.
Client
In the normal use case of zsync the client figures out which parts are
needed from the server. Now we need to find the parts in common with
the server. Which parts needs to go. And which parts need to be added.
This requires some new code but the info should all be available.
Since the server is not doing much here all the computational load is
shifted to the client. Also in the current setup we trust the clients
to generate the zsync files (this is hell in PHP) and send them. From
my point of view this is fine since any client can just do a PUT
request now anyway.
I hope to have a POC (in C so easily portable to the client) soonish.
Activity
jospoortvliet commentedon May 22, 2015
@danimo @dragotin @ogoffart @guruz could you guys give some input here perhaps?
ogoffart commentedon May 22, 2015
Hi @gadLinux , thank you for trying to help on this issue.
The client is no longer using httpf. And is using only very few parts of csync.
You need to contribute in the client repository. (and in the core)
You will find the code that uploads files in
src/libsync/propagateupload.cpphere you will find the code that split the file in chunks and uploads them.Similarily, the code that download the files is in
src/libsync/propagatedownload.cpp(this is not using chunks)Good luck :-)
But be warned that i think it is a difficult issue. I don't really know if it is possible to do that on top of webdav so you will probably need some kind of extensions to the protocol.
dragotin commentedon May 22, 2015
Some brainstorming:
There needs to be a list of blocks with its according checksums stored on the server for every file. It will be accessible through a special route on the server API.
The client will need to fetch the list once it detected that an existing file has changed and is to be uploaded. Once the blocklist has arrived, the client needs to recalculate the blocklist on the new, changed file. After that, the client can compare the lists and identify the blocks that have a changed checksum. These are the blocks that need to be uploaded.
To upload only parts of files, maybe the HTTP PATCH command (RFC) helps. The server needs to be able to handle this command and reassemble the whole file.
For files that appear new on the client, the client will have to calculate the blocklist and send it along the initial upload to the server to avoid having the server to calculate the list. Also, for each uploaded block, the client will send the new checksum along. The server will either recalculate or invalidate the blocklist for files that were changed on third party storage.
The client needs to be able to deal with the fact that the server can not provide a blocklist for a file and will transparently fall back to uploading the entire file.
The kind of checksum is configurable, and will be adjustable by a server configuration later.
danimo commentedon May 22, 2015
A good starting point for a rsync-like approach using HTTP is zsync, aka client-side rsync. I don't think using librsync is feasible, as we want to stick to HTTP(S) as transport protocol.
gadLinux commentedon May 25, 2015
Hi Olivier,
Thank you for the feedback. I will see what parts are in use on csync.
Because I have thinking about two approach. One is to implement the
rsync protocol to transfer the file, and the second one is use something
like bitttorrent. So it can transfer only the parts needed for it but
also leave doors open for multiple client sync against same file in a
decentralized way.
I suppose that the first way is easier and better for now.
Let me check the code.
What's the most recent branch of development in both projects? I found
there are many and many commits on each branch.
Best regards,
El 22/05/15 a las 12:20, Olivier Goffart escribió:
danimo commentedon May 25, 2015
@gadLinux Please stick with HTTP. Other protocols are not usable in certain scenarios (Port 80 and 443 are always open, others often are not). On top of that, another advantages with the HTTP-based zsync approach is that the server can remain mostly passive, which shifts a lot of load to the client. This improves scalability.
gadLinux commentedon May 27, 2015
Hi,
So it's important to reimplement solution over HTTP. Okay, I hope I can
do it this weekend or so.
Did you think about using thrift?
Best regards,
El 25/05/15 a las 11:40, Daniel Molkentin escribió:
ogoffart commentedon May 27, 2015
It does not have to be HTTP, but it would be better. (The configuration of an owncloud server has to remain simple). Anyway if it doesn't work we can still fallback to the normal method.
Anyway, as I said, we are slowly moving away from csync, and new code on the client should be written in C++ in the libsync directory.
Bittorrent-like protocol would be something different, that opens its own cans of worms (how do you do authantication or security if you are peer to peer?)
danimo commentedon May 27, 2015
Do not try to solve two problems at once. The basic idea behind ownCloud is that the server stays in control of the data, so p2p would involve getting a server authorization first. This requires oauth, which is scheduled for one of the next ownCloud server versions. The p2p implementation would then be purely client-side, and not involve the server at all, except for the authorization request.
gadLinux commentedon May 28, 2015
and the second one is use something like bitttorrent. So it can transfer
only the parts needed for it but also leave doors open for multiple
client sync against same file in a decentralized way.
Yo are right, I agree. Let me take a look to the partial file sync problem.
jospoortvliet commentedon May 28, 2015
@gadLinux perhaps it makes sense to have a Skype call about this to avoid a lot of work going in a direction that won't work ;-)
rullzer commentedon Jun 30, 2015
Ok so I have been looking into this and reading up on zsync (and by extend rsync). And I think this is something that can be done. Luckily the zsync library is available so I'm modifying that to get a POC working. Since at least the upload use case is not what is was designed for.
I'll hopefully soon put that work on github. So stay tuned. But let me here (quickly) write down how I think this should work.
Assumptions
Setup
Server
The server has only 2 tasks. Store the -zsync files. And generate the new file. This is to keep things scalable and not have the server do all the checksumming.
We need to come up with a protocol to tell the server how to assemble the new file. I'll be thinking about that.
We do require space for this to work since you need to copy the original file. And only copy it back once everything is done. Probably locking is also a good idea.
Client
In the normal use case of zsync the client figures out which parts are needed from the server. Now we need to find the parts in common with the server. Which parts needs to go. And which parts need to be added. This requires some new code but the info should all be available.
Since the server is not doing much here all the computational load is shifted to the client. Also in the current setup we trust the clients to generate the zsync files (this is hell in PHP) and send them. From my point of view this is fine since any client can just do a PUT request now anyway.
I hope to have a POC (in C so easily portable to the client) soonish.
CC: @danimo
powerpaul17 commentedon Jun 30, 2015
I think it should work this way both for the upload and the download because we already know which file is the "newer" one. The client calculates the parts which have to be transferred and the direction is then depending on the sync status.
For the upload there should be something like a HTTP PATCH request.
gadLinux commentedon Jun 30, 2015
Hi,
Looks great! Finally I didn't have time to go into deep. But if you fail
or need help please let me know.
Best regards,
El 30/06/15 a las 09:37, Roeland Douma escribió:
62 remaining items
This commit adds the required server-side support for delta-sync.
This commit adds the required server-side support for delta-sync.
This commit adds the required server-side support for delta-sync.
This commit adds the required server-side support for delta-sync.
This commit adds the required server-side support for delta-sync.
gadLinux commentedon Mar 27, 2018
Is this finally merged? and bounty claimed?
PVince81 commentedon Mar 27, 2018
The server side code was merged at least
guruz commentedon Mar 20, 2019
This feature will be in the upcoming 2.6 alpha release.
Meanwhile you can try it inside the daily builds 2.6.x https://download.owncloud.com/desktop/daily/
This commit adds the required server-side support for delta-sync.