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

Selective sync: Skip excluded folders when reading db #5772

Merged
merged 1 commit into from
May 16, 2017
Merged

Conversation

ckamm
Copy link
Contributor

@ckamm ckamm commented May 15, 2017

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

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

@ckamm
Copy link
Contributor Author

ckamm commented May 16, 2017

@ogoffart Yes, testing and documentation are still missing.

@guruz
Copy link
Contributor

guruz commented May 16, 2017

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

ckamm commented May 16, 2017

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 changed the base branch from master to 2.3 May 16, 2017 12:02
@michaelstingl
Copy link
Contributor

Will it be in tomorrow's nightlies?

@ckamm ckamm merged commit c5a0ce5 into 2.3 May 16, 2017
@ckamm
Copy link
Contributor Author

ckamm commented May 16, 2017

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

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

Copy link
Contributor Author

@ckamm ckamm May 17, 2017

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