Skip to content

Selective sync: Skip excluded folders when reading db - #5772

Merged
ckamm merged 1 commit into
2.3from
selective-sync-db
May 16, 2017
Merged

ckamm merged 1 commit into
2.3from
selective-sync-db

Conversation

@ckamm

@ckamm ckamm commented May 15, 2017

Copy link
Copy Markdown
Contributor

When a new folder becomes selective-sync excluded, we already mark it
and all its parent folders with invalid etags to force rediscovery.

That's not enough however. Later calls to csync_statedb_get_below_path
could still pull data about the excluded files into the remote tree.

That lead to incorrect behavior, such as uploads happening for folders
that had been explicitly excluded from sync.

To fix the problem, statedb_get_below_path is adjusted to not read the
data about excluded folders from the database.

Currently we can't wipe this data from the database outright because we
need it to determine whether the files in the excluded folder can be
wiped away or not.

See owncloud/enterprise#1965

@ckamm ckamm added this to the 2.4.0 milestone May 15, 2017
@ckamm ckamm self-assigned this May 15, 2017
@ckamm
ckamm requested a review from ogoffart May 15, 2017 12:55

@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.

Could there be a test for it? (using the FakeFolder framework)

@ckamm

ckamm commented May 16, 2017

Copy link
Copy Markdown
Contributor Author

@ogoffart Yes, testing and documentation are still missing.

@guruz

guruz commented May 16, 2017

Copy link
Copy Markdown
Contributor

@ckamm Could you put this in the 2.3 branch instead?
Then @michaelstingl can make a 2.3.3git build for the customer to test.
(I think it's ok to merge without test for now?)

@ckamm
ckamm force-pushed the selective-sync-db branch from 0212ba5 to 31b546f Compare May 16, 2017 11:57
@ckamm

ckamm commented May 16, 2017 •

Copy link
Copy Markdown
Contributor Author

Added a test that failed before and passes now - as well as some documentation and retargeted for 2.3.

When a new folder becomes selective-sync excluded, we already mark it
and all its parent folders with _invalid_ etags to force rediscovery.

That's not enough however. Later calls to csync_statedb_get_below_path
could still pull data about the excluded files into the remote tree.

That lead to incorrect behavior, such as uploads happening for folders
that had been explicitly excluded from sync.

To fix the problem, statedb_get_below_path is adjusted to not read the
data about excluded folders from the database.

Currently we can't wipe this data from the database outright because we
need it to determine whether the files in the excluded folder can be
wiped away or not.

See owncloud/enterprise#1965
@ckamm ckamm modified the milestones: 2.3.3 (Qt 5.6.2 for Linux), 2.4.0 May 16, 2017
@ckamm
ckamm force-pushed the selective-sync-db branch from 31b546f to c5a0ce5 Compare May 16, 2017 12:02
@ckamm
ckamm changed the base branch from master to 2.3 May 16, 2017 12:02
@michaelstingl

Copy link
Copy Markdown
Contributor

Will it be in tomorrow's nightlies?

@ckamm
ckamm merged commit c5a0ce5 into 2.3 May 16, 2017
@ckamm

ckamm commented May 16, 2017

Copy link
Copy Markdown
Contributor Author

@michaelstingl I've merged it now, should be in the nightlies. @guruz ?

Comment thread test/testsyncengine.cpp
// The local state should still have subFolderA
auto local = fakeFolder.currentLocalState();
QVERIFY(local.find("parentFolder/subFolder"));
QVERIFY(local.find("parentFolder/subFolder/fileA.txt"));

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 does it still have fileA.txt ?
That looks like a bug to me.

@ckamm ckamm May 17, 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.

@ogoffart I thought that was intentional. Currently it either deletes the whole folder -- or doesn't do anything about it. Was the originally intended behavior to remove all files that should be safe to remove?

The culprit is checkForPermissions, which sets all subitems to IGNORED.

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.

---> #5783

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