Skip to content

Implementation of delta-sync support on client-side.#6131

Closed
ahmedammar wants to merge 3 commits into
owncloud:masterfrom
ahmedammar:master
Closed

Implementation of delta-sync support on client-side.#6131
ahmedammar wants to merge 3 commits into
owncloud:masterfrom
ahmedammar:master

Conversation

@ahmedammar

@ahmedammar ahmedammar commented Oct 27, 2017

Copy link
Copy Markdown
Contributor

This commit adds client-side support for delta-sync, this adds a new 3rdparty submodule gh:ahmedammar/zsync. This zsync tree is a modified version of upstream, adding some needed support for the upload path and other requirements.

If the server does not announce the required zsync capability then a full upload/download is fallen back to.

On both upload and download paths, a check is made for the existance of a zsync metadata file on the server for a given path. If it doesn't exist the code reverts back to a complete upload or download, i.e. previous implementations. In the case of upload, a new zsync metadata file will be uploaded as part of the chunked upload and future synchronizations will be delta-sync capable.

Chunked uploads no longer use sequential file names for each chunk, instead, they are named as the byte offset into the remote file, this is a minimally intrusive modification to allow fo delta-sync and legacy code paths to run seamlessly. A new http header OC-Total-File-Length is sent, which informs the server of the final expected size of the file not just the total transmitted bytes as reported by OC-Total-Length.

The seeding of the zsync metadata file is done in a seperate thread since this is a cpu intensive task, ensuring main thread is not blocked.

Added configuration and command-line options to gui and cmd applications. Delta-sync is disabled by default, this can be changed once more testing is done.

@CLAassistant

CLAassistant commented Oct 27, 2017

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ahmedammar
ahmedammar force-pushed the master branch 9 times, most recently from 218ec16 to 9a30f6e Compare October 28, 2017 19:24
@ahmedammar
ahmedammar force-pushed the master branch 10 times, most recently from 7fd7b14 to a201a45 Compare October 29, 2017 14:37
@ckamm
ckamm self-requested a review October 30, 2017 09:54
@ahmedammar
ahmedammar force-pushed the master branch 6 times, most recently from aa21f0d to 0ed21aa Compare October 31, 2017 22:29

@ckamm ckamm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of first third.

Comment thread src/libsync/syncfileitem.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: Place this next to the other bitfields to keep SyncFileItem size small.

Also please add documentation about what these fields mean. (we don't have docs everywhere we'd like, but make an attempt to good documentation on new code and changes)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Comment thread src/libsync/progressdispatcher.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add:

adjustTotalsForFile is called during the treewalk phase to collect the initial total size and file count. updateTotalsForFile is called at most once per item during propagation to adjust them when new information has become available.

Example: With delta-sync, the actual size of the download will only be known during propagation - this function adjusts the total size to account for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added.

Comment thread src/libsync/syncfileitem.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this member isn't necessary for other reasons it might be worthwhile to get rid of it and pass the size as an argument in the updateTotalsForFile signal/call. We have a lot of SyncFileItems alive at the same time and have run into memory issues before. You may even be able to drop _isZsync that way -- unless it's necessary in the follow up commit that I haven't read yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

Comment thread src/gui/generalsettings.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Possible bug: The getter returns the min size in bytes, the setter takes the size in megabytes?

If the getter and setter use different units, I suggest changing that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread src/libsync/CMakeLists.txt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: Is compiling the zsync code into the owncloud client compatible with their license and our license?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, already checked by @hodyroff. owncloud/core#16162 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also for the code you copied (vs linked) like read_stream_write_blocksums @hodyroff ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even if this is fine license wise, it is bad to copy in the dependency. Maybe it makes sense to have it bundled for Win and Mac (it could also simply be built there as separate file), but Linuxes ship this library. It is bad to duplicate the code, we discussed this before ;-) .

What is the plan? Are you planning to bundle it in the final source ball? I think it would be better to not do that.

@ahmedammar ahmedammar Nov 10, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are you talking about zlib specifically? It's actually not even really used, I can strip out all the support from zsync, I only did that to help me compile initially, and reduce any major changes to zsync sources.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, stripped zlib from zsync using preprocessor flag.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not zlib specifically, also zsync

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I really don't understand the issue, the source isn't bundled, it's a git submodule. There are some needed changes to zsync for it to support what is needed so I don't see any other way around that at this point ...

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check seems odd, since file isn't used below. You could check _previousSize > 0? If you do want to keep it, produce an error if (!file.open(...)) and de-indent the happy case.

@ahmedammar ahmedammar Nov 2, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is just to check that we have a file to seed from, otherwise no point doing delta-sync. I removed the else and removed some duplicate code since it can fall-through. Hard to do that if I de-indent the happy case, let me know your thoughts now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't see the fallthrough, makes sense then.

You shouldn't have to go to the filesystem to check whether there's a base file since the previous phases have already discovered all of that - hence I suggested just checking _previousSize. But it's a minor thing.

@ahmedammar ahmedammar Nov 2, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

checking _item->_previousSize > 0 instead now, fixed.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this really a warning or something that will regularly come up? I.e. does the server provide a zsync control file for each file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

qCInfo is probably more appropriate, fixed.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unnecessary check unless something weird is going on in GetFileZsyncJob

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this was left-over from old debug. Removed.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfortunate large chunk of duplicated code. Get rid of it if at all possible. What are the differences between GetFinished and ZsyncFinished -- can we arrange such that there aren't any?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfortunate indeed, slotGetZsyncFinished is gone now.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What? How can that be right? A zsync-downloaded can still create a local conflict - why would the method of data transfer make the conflict go away?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure why I needed that now, I vaguely remember ._conflict files being created and this being the reason but I don't actually seem to need it now. Removed.

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I apologize if i say stuff that were already said, for i just read the diff and not the previous comment that were made.

Very good work, thank you.

Is there any way that prevent the meta-data and the data to be out of sync because of a race condition:
What if the file on the server changes right after the metadata was downloaded? We need to make sure that the etag of the metadata matches that of the the file. Are you doing that?

Also, is there no cases where we should simply fallback to the normal download or upload if we detect that the file has changed too much?

Comment thread src/gui/generalsettings.ui Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also think it is better not to have the setting in the UI.
It should simply be enabled by default with a sensible size.
We can keep a hidden setting in the config file.

Comment thread src/libsync/CMakeLists.txt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do you need this?
I was under the impression that we already compile with large file sypport.

Comment thread .gitmodules Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you using a fork of zsync?
Can your change be upstreamed in the official repo?
Linux distributions will want to use their package version of zsync.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The repo owner of zsync is not that responsive, and some changes are very specific to the needs. For example, changes needed when uploading chunks, that's completely unsupported by zsync.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So that means that owncloud has to maintain this fork :-/
And also that nobody is really reviewing these changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not much I can do about that.

Comment thread src/libsync/CMakeLists.txt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The best would be nice if zsync itself was shipping a cmake module. Otherwise we could still have a cmake module in our repo so this does not have to be done like that (and could potentially be easily disabled)
Would just be better. Does not need to be done in the first release.

Comment thread src/libsync/discoveryphase.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any performance impact on the server?
(We had problem previously that some property were slow to check on the server and adding them here would make the discovery much slower)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's just a check on if a file exists, which should be using the file cache, should be fast.

Comment thread src/libsync/propagatecommonzsync.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/fname/_zsyncFilePath/

No need to converto to 8bit and back again.

Comment thread src/libsync/propagatecommonzsync.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wondering why you need to do that. Can you not use the file descriptor from QFile directly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Duplicating the handle was because I read that closing a file handle for a QFile is a bug: https://stackoverflow.com/questions/9465727/convert-qfile-to-file/16876527#16876527

Comment thread src/libsync/propagatecommonzsync.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use QByteArray here (and no constData())

Comment thread src/libsync/propagatecommonzsync.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tr()

Comment thread src/libsync/propagatecommonzsync.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not? if the server says it has zsync enabled why should it not work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because external drives are out of oC control, if they change then the metadata will be completely out-of-sync and corruption will ensue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Then oC should not set that zsync is enabled for these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, it's not that simple, oC doesn't have that much control over the process, the client has more, oC will not put the metadata if the client sends it for a file stored externally, but by that time the client has already done the cpu-intensive tasks of generating the metadata file and sent it. The client saves a lot by not doing that in the first place ...

@ahmedammar

ahmedammar commented Nov 15, 2017

Copy link
Copy Markdown
Contributor Author

What if the file on the server changes right after the metadata was downloaded? We need to make sure that the etag of the metadata matches that of the the file. Are you doing that?

No idea how to do that to be honest, currently I rely on the checksum failing to catch this edge case.

Also, is there no cases where we should simply fallback to the normal download or upload if we detect that the file has changed too much?

This should be easy to do, but then the question is what is the threshold? >75%? >50% ?

Comment thread src/libsync/propagateuploadng.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could be put in a unique_ptr

Comment thread test/syncenginetestutils.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👎 This makes the test void.
The goal was to test that all the chunk files are there and they are named properly.

See the QCOMPARE(sourceFolder->children.count(), count); // There should not be holes or extra files later, how can that fail with the current code?

So i'd just change the 8 with a 16.

@ahmedammar ahmedammar Nov 16, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that was on my TODO, to fix properly.

8 to 16 will not fix this problem, the problem is that count is no longer a valid approach because chunkId is not a simple auto incrementing number, it's the offset into the file now ...

@ahmedammar ahmedammar Nov 16, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll need to implement a better way to check that all the chunkId's to chunkSize match the range 0 to item->_size, with no holes. Similar in idea to what is done by PropagateUploadFileNG::updateRanges.

@ogoffart

Copy link
Copy Markdown
Contributor

What if the file on the server changes right after the metadata was downloaded? We need to make sure that the etag of the metadata matches that of the the file. Are you doing that?

No idea how to do that to be honest, currently I rely on the checksum failing to catch this edge case.

Put the etag of the file in a header or somewhere in the metadata.
Then if the GET don't have the same etag, it means the file is no longer matching and you can retry.
And the PUT/MOVE will fail bacause of the If-Match

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another missing thing is the tests :-)

(I wish there was a way to make the zsync and upload code less mixed.
The code of the propagateuploadng for example becomes quite complicated.)

Comment thread src/libsync/propagatecommonzsync.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What errors do you get ? This should work.

Comment thread src/libsync/propagatecommonzsync.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use the inline initialization:

size_t _blocksize = 1048576;
off_t _len = 0;

So you don't need to repeat that in the constructor.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resume the transfer if the previous transfer aborted in the middle of the file (connection was cut)

What does the temporary file contains in this case?
In the normal download case, the temporary file is left on the disk and re-used for the next sync so we resume from that.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok good, that's small enough.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you have similar check for the delta sync?

This test exist because sometimes, the GET might end without error, but only contains a turncated file. (this happens sometimes when there is a gateway and the http chunk encoding is used)

Maybe if there is checksum check and that the file is correct, or the zsync algo detect corrupted patch files?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The final checksum check would definitely catch this.

Comment thread src/libsync/propagatedownload.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Again, this might break resuming.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Again, same answer as before, if we error'd when parsing zsync then this file was simply created and contains 0 bytes.

Comment thread src/libsync/propagatedownload.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

QByteArray is default constructed. and NULL is specific to C.

Please actually initialize everything inline.
The old code did not do that because we only dropped compiler that did not support C++11 very recently. But new code should use the C++11 way.

Comment thread src/libsync/propagateuploadng.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should you not check the DB entry for resuming, first?
Maybe then the metadata or some additional state need to be kept.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The ranges needed can't be known until the metadata is downloaded and seeded, the DB is checked after to see what's still needed/missing.

Comment thread src/libsync/propagateuploadng.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd rather you don't change the meaning of currentChunk for the normal (non zsync) upload.
This is going to cause problems, for example while resuming. (The logic in PropagateUploadFileNG::slotPropfindFinished will break)

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please also run git-clang-format on the change

Comment thread src/common/syncjournaldb.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is actually no reason to change that. The chunk is only used in the database for the old chunking algo. So please leave it as an int here.

Comment thread src/gui/generalsettings.ui Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, the problem is that this general settings page is already way too big, so adding more field in this tab is not a good idea at all.

@ahmedammar

ahmedammar commented Nov 20, 2017

Copy link
Copy Markdown
Contributor Author

@ogoffart

I've made some more changes as you requested and ran git clang-format on the commit.

Put the etag of the file in a header or somewhere in the metadata.
Then if the GET don't have the same etag, it means the file is no longer matching and you can retry.

I will add this and the DB flag for metadata. I am about to travel to start my new job soon, I doubt I will be able to add any more work to this after Wednesday.

@ahmedammar

Copy link
Copy Markdown
Contributor Author

When working on adding tests on the client side, I seem to have some bugs when tiny (1byte) modifications are made to the files. So I will need to come back to this when I have more time, the bugs must be somewhere in zsync code itself.

That and adding the original file etag when downloading are the main two blockers (functionally) right now.

Comment thread test/syncenginetestutils.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

( nitpick: i think you can do contents += contentCharp )

Comment thread test/syncenginetestutils.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(nitpick, there is an overload of write that takes a char* i thin, so you do not need to create a QByteArray for it)

Comment thread test/syncenginetestutils.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but this does not modify any bytes...

@ahmedammar

Copy link
Copy Markdown
Contributor Author

OK I'm done with the automated testing. I really need to stop working on this now. I'll be back in a few weeks. Reachable via email/github.

@ahmedammar

Copy link
Copy Markdown
Contributor Author

@ckamm @ogoffart @guruz @dragotin Can I know where this PR stands now? I had to rebase since some things changed upstream and merge was no longer possible. I'd really like to close this.

@ahmedammar

Copy link
Copy Markdown
Contributor Author

@ogoffart please review last [fixup] commit, adding support for Etag checks during download.

@ahmedammar

Copy link
Copy Markdown
Contributor Author

Bump.

1 similar comment
@ahmedammar

Copy link
Copy Markdown
Contributor Author

Bump.

Comment thread src/common/syncjournaldb.cpp Outdated
@@ -498,7 +498,13 @@ bool SyncJournalDb::checkConnect()
// local files and a remote discovery will fix them.
// See #5190 #5242.
if (major == 2 && minor < 3) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This if is no longer required. (covered by the latter)

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For some reason github can't show this pull request anymore. I always get the unicorn.
And i can't seem to add more comments.

@ckamm

ckamm commented Jan 11, 2018 via email

Copy link
Copy Markdown
Contributor

@ahmedammar

ahmedammar commented Jan 11, 2018 via email

Copy link
Copy Markdown
Contributor Author

This commit adds client-side support for delta-sync, this adds a new
3rdparty submodule gh:ahmedammar/zsync. This zsync tree is a modified
version of upstream, adding some needed support for the upload path and
other requirements.

If the server does not announce the required zsync capability then a
full upload/download is fallen back to. Delta synchronization can be
enabled/disabled using command line, config, or gui options.

On both upload and download paths, a check is made for the existance of
a zsync metadata file on the server for a given path. This is provided
by a dav property called `zsync`, found during discovery phase. If it
doesn't exist the code reverts back to a complete upload or download,
i.e. previous implementations. In the case of upload, a new zsync
metadata file will be uploaded as part of the chunked upload and future
synchronizations will be delta-sync capable.

Chunked uploads no longer use sequential file names for each chunk id,
instead, they are named as the byte offset into the remote file, this is
a minimally intrusive modification to allow fo delta-sync and legacy
code paths to run seamlessly. A new http header OC-Total-File-Length is
sent, which informs the server of the final expected size of the file
not just the total transmitted bytes as reported by OC-Total-Length.

The seeding and generation of the zsync metadata file is done in a
seperate thread since this is a cpu intensive task, ensuring main thread
is not blocked.

This commit closes owncloud#179.
@ahmedammar

Copy link
Copy Markdown
Contributor Author

Can only seem to load it on my mobile, not my laptop, closing this now ...

@ahmedammar

Copy link
Copy Markdown
Contributor Author

See #6297.

@guruz

guruz commented Mar 20, 2019

Copy link
Copy Markdown
Contributor

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/

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.

7 participants