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

Classify chunked items correctly. Issue #5850 #5852

Merged
merged 1 commit into from
Jul 3, 2017
Merged

Conversation

mrow4a
Copy link
Contributor

@mrow4a mrow4a commented Jun 20, 2017

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.

@mrow4a
Copy link
Contributor Author

mrow4a commented Jun 20, 2017

selection_029

@@ -379,7 +379,8 @@ PropagateItemJob *OwncloudPropagator::createJob(const SyncFileItemPtr &item)
return job;
} else {
PropagateUploadFileCommon *job = 0;
if (item->_size > _chunkSize && account()->capabilities().chunkingNg()) {
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@ogoffart ogoffart left a 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.

@@ -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.
Copy link
Contributor

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

Copy link
Contributor Author

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()) {
Copy link
Contributor

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.

@@ -79,6 +79,7 @@ void PropagateUploadFileV1::startNextChunk()
qint64 chunkStart = 0;
qint64 currentChunkSize = fileSize;
bool isFinalChunk = false;

Copy link
Contributor

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 :)

@guruz guruz added this to the 2.4.0 milestone Jun 21, 2017
@mrow4a
Copy link
Contributor Author

mrow4a commented Jun 21, 2017

Done

Copy link
Contributor

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@ckamm ckamm left a 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
Copy link
Contributor

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.

@mrow4a
Copy link
Contributor Author

mrow4a commented Jun 27, 2017

@guruz why the jenkins test is not passing (it is also not for master), can we merge this PR?

@ogoffart
Copy link
Contributor

ogoffart commented Jul 3, 2017

@mrow4a the jenkins error seems to be unrelated to this change:

6: QWARN  : TestSyncJournalDB::testFileRecord() sync.database.sql: Sqlite exec statement error: 5 "database is locked" in "INSERT OR IGNORE INTO checksumtype (name) VALUES (?1)"
6: QWARN  : TestSyncJournalDB::testFileRecord() sync.database.sql: Sqlite exec statement error: 5 "database is locked" in "INSERT OR REPLACE INTO metadata (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, contentChecksum, contentChecksumTypeId) VALUES (?1 , ?2, ?3 , ?4 , ?5 , ?6 , ?7,  ?8 , ?9 , ?10, ?11, ?12, ?13, ?14, ?15, ?16);"
6: FAIL!  : TestSyncJournalDB::testFileRecord() 'storedRecord == record' returned FALSE. ()
6:    Loc: [/var/lib/jenkins/workspace/cloud-client_client_PR-5852-5C3JT3EY7EHDKWSDVRI76HKJJMTNLBZ76KGHLTTGG25CKR2ASZYA/test/testsyncjournaldb.cpp(78)]

I'd say we can merge this change. yes

@guruz guruz merged commit d1e0009 into master Jul 3, 2017
@guruz guruz deleted the fix_chunking_ng branch July 3, 2017 12:41
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.

4 participants