[USS] Avoid clearing ModelTypeStore/LevelDB |
||
Issue descriptionModelTypeStore/LevelDB holds actual data that has no other local copy. As such, it cannot be freely deleted as the directory/sqllite database is currently. Right now we do delete it, and this needs to change. We layout of data currently looks like .../Profile/ .../Profile/Sync Data/ .../Profile/Sync Data/SyncData.sqlite3 .../Profile/Sync Data/SyncData.sqlite3-journal .../Profile/Sync Data/LevelDB/ .../Profile/Sync Data/LevelDB/<many files> We have logic that completely removes this folder in two places: https://cs.chromium.org/chromium/src/components/browser_sync/profile_sync_service.cc?l=184 https://cs.chromium.org/chromium/src/components/sync/driver/glue/sync_backend_host_core.cc?l=653 There are a couple of options for what to do here: We could move the LevelDB out of the Sync Data folder. This raises the question, what should we name it? "LevelDB" is probably not a great top level folder in the profile folder. Some suggestions we've seen so far .../Profile/LevelDB/ .../Profile/Syncable Data/ .../Profile/Shared LevelDB/ .../Profile/Model Type Store/ .../Profile/SharedDB/ .../Profile/Sync Data.LevelDB/ .../Profile/USS Sync Data/ .../Profile/LevelDB Store/ Part of the ambiguity is about what will this store eventually hold? One could imagine in the future that we may want to expand the purpose of this store past just model types integrating with sync. The overhead of having your own LevelDB to store a tiny amount of data is not insignificant. On the other hand, maybe even this is not generic enough. It is possible that we may not want to put all ModelTypeStore integrating types into the same LevelDB for performance reasons. They maybe have drastically different access patterns that could conflict. In which case, maybe we want sub-folders for each specific LevelDB. There could be a default one that you get if you don't specify an extra qualifier, but you would be able to control it during model type initialization. .../Profile/Shared LevelDB/Default/ .../Profile/Shared LevelDB/Bookmarks/ .../Profile/Shared LevelDB/Passwords/ However, neither of the above two generalizations may ever occur, and wasting time worrying about them may be pointless. From another perspective, it would be ideal if we didn't have to create a new top level folder for each profile. Instead, what if we kept the ModelTypeStore LevelDB in the Sync Data folder, and just got slightly smarter when deleting, and only removed the sqllite files. As long as we are reasonably confident we can always remove the sqllite files, and never remove the LevelDB ones, this should work. If we knew we were going to introduce another storage years ago when we first added the sqllite storage, it would be been convenient if we placed all the files in their own sub folder .../Profile/Sync Data/sqllite/SyncData.sqllite3 .../Profile/Sync Data/sqllite/SyncData.sqllite3-journal We theoretically could try to move the existing sqllite files into such a structure, but our current feeling is that the risk is quite great, and the benefits would be extremely small. So the sqllite files will be left as is.
,
Dec 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf commit 4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf Author: skym <skym@chromium.org> Date: Tue Dec 20 17:29:37 2016 [Sync] Stop deleting LevelDB files when deleting Directory The LevelDB folder backing ModelTypeStore is inside Sync Data folder. While this change is being driven by race conditions from sync trying to delete this folder while it is being used, this setup is fundamental flawed. The ModelTypeStores will hold model type specific information that needs to be persistent across sign outs and disabling sync. The approach this CL takes to fix this problem is the modify the deletion logic to only affect the Directory (sqllite3) files. This means that the Sync Data folder will still exist even when sync is off. BUG= 673508 , 673887 Review-Url: https://codereview.chromium.org/2568743004 Cr-Commit-Position: refs/heads/master@{#439835} [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/browser_sync/profile_sync_components_factory_impl.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/browser_sync/profile_sync_components_factory_impl.h [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/browser_sync/profile_sync_service.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/browser_sync/profile_sync_service.h [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/driver/glue/sync_backend_host_core.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/driver/glue/sync_backend_host_core.h [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/driver/glue/sync_backend_host_impl.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/driver/glue/sync_backend_host_impl.h [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/driver/sync_service_base.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/driver/sync_service_base.h [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/syncable/directory.cc [modify] https://crrev.com/4234d3c65dc2b0ad0cf19fbf5e9e1e528bc3ddaf/components/sync/syncable/directory.h
,
Feb 22 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by s...@chromium.org
, Dec 13 2016