Skip to content

Dbjournal per account - #5045

Merged
ckamm merged 35 commits into
masterfrom
dbjournal_per_account
Dec 6, 2016
Merged

ckamm merged 35 commits into
masterfrom
dbjournal_per_account

Conversation

@dragotin

@dragotin dragotin commented Jul 10, 2016 •

Copy link
Copy Markdown
Contributor

This patch changes the name of the sync journal. It adds a component that is built from the remote account. That is supposed to fix the root cause of #3764 and makes it possible to sync a local folder to multiple servers.

Note that this is experimental and still lacks these things:

  • Fix of the tests
  • Maybe more tests
  • Manual testing
  • An update strategy
  • Some code in owncloudcmd and FolderMan, see FIXMEs

Comments are welcome @ogoffart @danimo @ckamm

@guruz

guruz commented Jul 11, 2016

Copy link
Copy Markdown
Contributor

@danimo @DeepDiver1975 Where did @mention-bot go?

@ckamm

ckamm commented Jul 19, 2016

Copy link
Copy Markdown
Contributor

@dragotin Looks good to me so far! The exclude pattern for the journal file also needs updating. There are a couple of other places that also have the "csync_journal" string (like folderwatcher_linux).

@guruz guruz added this to the 2.3.0 milestone Jul 25, 2016
@guruz

guruz commented Jul 28, 2016

Copy link
Copy Markdown
Contributor

How will this work when the client picks a new sync directory for an unrelated server?
E.g. I add an account to test something else and oC by default picks ~/ownCloud and I accidently click OK.
Will it mess up everything?

@dragotin

dragotin commented Sep 2, 2016

Copy link
Copy Markdown
Contributor Author

Plus csync test fixes, and adoption to the new cmocka API.

The filename must not be wiped in csync_commit as that is
happening after every sync. It is only set once in the
constructor of the SyncEngine in csync_init().
Migration strategy to the new filename.
One local folder can now be configured as sync target for multiple
accounts as long as their url and user differ.

Also this patch accepts that the sync folder is behind a symlink.
Also this patch fixes a bug that before the user input was taken
canonically which was not working for the symlink handling.
@dragotin

dragotin commented Oct 7, 2016

Copy link
Copy Markdown
Contributor Author

@ogoffart @guruz @jturcotte what do you guys think?

@ckamm

ckamm commented Nov 22, 2016 •

Copy link
Copy Markdown
Contributor

Also, it seems that in my tests the big-folder choices got lost and they were displayed as new. Will have to investigate. EDIT: Fixed. There was a bug that wiped all journals on each start.

@ckamm

ckamm commented Nov 22, 2016 •

Copy link
Copy Markdown
Contributor

There's also currently a problem where having two different accounts on the same server will end up with the same sync journal db name, because the credentials are not part of the hash. I wonder whether we have access to the username early enough to make it affect the db name.

@ckamm

ckamm commented Nov 23, 2016

Copy link
Copy Markdown
Contributor

@dragotin What's the rationale for deriving the DB name from the url? The main advantage I see over just using a random value is that the same db might be reused even if the settings are lost. And that seems relatively small. If we used a random value we could completely sidestep the question of whether the user is available at that time already.

@ckamm

ckamm commented Nov 23, 2016

Copy link
Copy Markdown
Contributor

One complication is owncloudcmd: If we determine the db filename automatically from url, path and username, we can avoid having to pass the db name explicitly.

@ckamm

ckamm commented Nov 23, 2016 •

Copy link
Copy Markdown
Contributor

The main thing that still needs doing (besides more thorough tests!) is to update the manual tests: they still use .csync_journal.db explicitly in a couple of places.

@ckamm
ckamm force-pushed the dbjournal_per_account branch from a4b36b0 to 49f8143 Compare November 23, 2016 15:48
@dragotin

Copy link
Copy Markdown
Contributor Author

@ckamm I was not thinking into the direction of using a random name and storing in the settings. Might be a good idea, I am not sure...

@ckamm

ckamm commented Nov 25, 2016

Copy link
Copy Markdown
Contributor

@dragotin I've gone with the hash-based approach, because that allows owncloudcmd to determine the right database from the host, folder, username arguments. Otherwise people would have had to pass the db path explicitly to it and we'd have broken all existing uses of owncloudcmd...

@ckamm

ckamm commented Nov 25, 2016 •

Copy link
Copy Markdown
Contributor

@ogoffart This is ready for a final round of review. All looks good from my point of view now. I'll spend time on manual tests and see if I can make anything fail.

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

👍

Comment thread src/gui/folderman.cpp
const QString userDirClean = QDir::cleanPath(path)+'/';

// folderDir follows sym links, path not.
bool differentPathes = !Utility::fileNamesEqual(QDir::cleanPath(folderDir), QDir::cleanPath(path));

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 we not canonicalize?

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.

Utility::fileNamesEqual canonicalizes both arguments. Which makes me wonder why we call cleanPath. Should be no problem to drop that, right?

Comment thread src/gui/folderwizard.h Outdated
Q_OBJECT
public:
FolderWizardLocalPath();
FolderWizardLocalPath(AccountPtr account);

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.

const &

@ogoffart

Copy link
Copy Markdown
Contributor

Actually, -1, because:

/var/lib/jenkins/workspace/cloud-client_client_PR-5045-XH7FKQPHY3F2PM4KGS2TZBW2XEBGFRDAIIQA4PWGEYSSPLSHKLIA/test/testutility.cpp:163:50: error: ‘qunsetenv’ was not declared in this scope
         qunsetenv("OWNCLOUD_TEST_CASE_PRESERVING");
                                                  ^

@ckamm

ckamm commented Nov 29, 2016 •

Copy link
Copy Markdown
Contributor

Bug:

  • [ ] Sync journals and the wal and shm files appear in the not-synced tab (wrong branch, doh)

@ckamm

ckamm commented Nov 29, 2016

Copy link
Copy Markdown
Contributor

@ogoffart Comments addressed.

@ogoffart

Copy link
Copy Markdown
Contributor

👍 :

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.

5 participants