-
Notifications
You must be signed in to change notification settings - Fork 663
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
Classify chunked items correctly. Issue #5850 #5852
Conversation
@@ -379,7 +379,8 @@ PropagateItemJob *OwncloudPropagator::createJob(const SyncFileItemPtr &item) | |||
return job; | |||
} else { | |||
PropagateUploadFileCommon *job = 0; | |||
if (item->_size > _chunkSize && account()->capabilities().chunkingNg()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of that, after dynamic chunk has been readjusted to 100MB, this file has been classified as V1, being 50MB in size. With _initialChunkSize being 10MB, it is classified as to be chunked and having high dynamic chunk, being send in one shot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's correct. Thanks for spotting and fixing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. Please just fix or remove the missleading comment before pushing.
src/libsync/propagateuploadng.cpp
Outdated
@@ -400,6 +400,7 @@ void PropagateUploadFileNG::slotPutFinished() | |||
// the chunk sizes a bit. | |||
quint64 targetSize = (propagator()->_chunkSize + predictedGoodSize) / 2; | |||
|
|||
// Adjust chunk size for the item being classified to be chunked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is wrong. This has nothing to do with the classification, quite the contrary. It is the actual size that will be used by the chunking-ng algorithm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe I need to rewrite this. The intiention was to say that this is the dynamic chunk size of the item, which has been classified to be chunked.
@@ -379,7 +379,8 @@ PropagateItemJob *OwncloudPropagator::createJob(const SyncFileItemPtr &item) | |||
return job; | |||
} else { | |||
PropagateUploadFileCommon *job = 0; | |||
if (item->_size > _chunkSize && account()->capabilities().chunkingNg()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's correct. Thanks for spotting and fixing this.
src/libsync/propagateuploadv1.cpp
Outdated
@@ -79,6 +79,7 @@ void PropagateUploadFileV1::startNextChunk() | |||
qint64 chunkStart = 0; | |||
qint64 currentChunkSize = fileSize; | |||
bool isFinalChunk = false; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you anyway change the commit, remove this one too :)
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change we'll start using chunked upload via PropagateUploadFileNG
for files that will only have a single chunk. I assume that was tested and is safe.
@@ -53,9 +53,10 @@ struct SyncOptions | |||
/** If a confirmation should be asked for external storages */ | |||
bool _confirmExternalStorage; | |||
|
|||
/** The initial un-adjusted chunk size in bytes for chunked uploads | |||
/** The initial un-adjusted chunk size in bytes for chunked uploads, both | |||
* for old and new chunking algorithm, which classifies the item to be chunked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you say "which classifies the item to be chunked" (also below) that's confusing because it's ambiguous. "which is used to decide whether an item should be chunked" would be clearer.
@guruz why the jenkins test is not passing (it is also not for master), can we merge this PR? |
@mrow4a the jenkins error seems to be unrelated to this change:
I'd say we can merge this change. yes |
This should solve #5850.
Please note: we cannot set chunk size of PUT V1 to _chunkSize which is dynamic because PUT V1 will not adjust dynamic chunk size. If we want it, we need to make code adjusting dynamic chunk size both for V1 and NG.