Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Issue 10821121: sync: Attempt to recover from directory corruption (Closed)

Created:
8 years, 4 months ago by rlarocque
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), akalin, Nicolas Zea
Visibility:
Public.

Description

sync: Attempt to recover from directory corruption Sync when sqlite fails to maintain databsae integrity, most likely due to unexpected shutdowns or flaky storage devices. They can also be corrupted by logic errors in the sync code, though we hope that's a rare occurence. This patch attempts to improve a user's experience in this scenario by transparently deleting the old directory and re-downloading all their data. This will be much better than the old behaviours, which included silently signing a user out of sync, triggering an unrecoverable error, or crashing. To help catch sync logic bugs, debug builds are set to crash when they detect directory corruption. Also included in this patch is a new test. The DirectoryBackingStore.MinorCorruption test exercises the code invoked when the directory is successfully re-created. BUG=109668, 129825 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150465

Patch Set 1 #

Total comments: 8

Patch Set 2 : Review fixes #

Total comments: 3

Patch Set 3 : Update comment #

Patch Set 4 : Fix win compile warning #

Patch Set 5 : Fix other win compile warning #

Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -48 lines) Patch
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M sync/syncable/directory.cc View 2 chunks +0 lines, -38 lines 0 comments Download
M sync/syncable/directory_backing_store.h View 1 chunk +3 lines, -0 lines 0 comments Download
M sync/syncable/directory_backing_store.cc View 2 chunks +32 lines, -0 lines 0 comments Download
M sync/syncable/directory_backing_store_unittest.cc View 1 2 3 4 1 chunk +56 lines, -9 lines 0 comments Download
M sync/syncable/in_memory_directory_backing_store.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M sync/syncable/on_disk_directory_backing_store.h View 1 1 chunk +14 lines, -0 lines 0 comments Download
M sync/syncable/on_disk_directory_backing_store.cc View 1 2 chunks +62 lines, -1 line 0 comments Download
M sync/test/test_directory_backing_store.cc View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
rlarocque
Here's the remainder of the directory corruption handling patch. I've closed the original review. This ...
8 years, 4 months ago (2012-08-01 00:25:10 UTC) #1
tim (not reviewing)
http://codereview.chromium.org/10821121/diff/1/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): http://codereview.chromium.org/10821121/diff/1/chrome/browser/sync/profile_sync_service.cc#newcode394 chrome/browser/sync/profile_sync_service.cc:394: // won't make a difference. Hmm... I don't follow. ...
8 years, 4 months ago (2012-08-01 21:31:59 UTC) #2
rlarocque
Still working on an updated patch. http://codereview.chromium.org/10821121/diff/1/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): http://codereview.chromium.org/10821121/diff/1/chrome/browser/sync/profile_sync_service.cc#newcode394 chrome/browser/sync/profile_sync_service.cc:394: // won't make ...
8 years, 4 months ago (2012-08-01 21:53:50 UTC) #3
rlarocque
Patch updated. http://codereview.chromium.org/10821121/diff/1/sync/syncable/on_disk_directory_backing_store.cc File sync/syncable/on_disk_directory_backing_store.cc (right): http://codereview.chromium.org/10821121/diff/1/sync/syncable/on_disk_directory_backing_store.cc#newcode72 sync/syncable/on_disk_directory_backing_store.cc:72: // immediately so a developer can investigate. ...
8 years, 4 months ago (2012-08-01 22:37:51 UTC) #4
tim (not reviewing)
http://codereview.chromium.org/10821121/diff/5001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): http://codereview.chromium.org/10821121/diff/5001/chrome/browser/sync/profile_sync_service.cc#newcode671 chrome/browser/sync/profile_sync_service.cc:671: // directory. Whether or not we try to delete ...
8 years, 4 months ago (2012-08-02 00:31:18 UTC) #5
rlarocque
Updated the comment. http://codereview.chromium.org/10821121/diff/5001/sync/syncable/on_disk_directory_backing_store.cc File sync/syncable/on_disk_directory_backing_store.cc (right): http://codereview.chromium.org/10821121/diff/5001/sync/syncable/on_disk_directory_backing_store.cc#newcode77 sync/syncable/on_disk_directory_backing_store.cc:77: file_util::Delete(backing_filepath_, false); On 2012/08/02 00:31:18, timsteele ...
8 years, 4 months ago (2012-08-02 00:47:20 UTC) #6
tim (not reviewing)
LGTM and note, rlarocque is out today and I'll be guiding this through CQ.
8 years, 4 months ago (2012-08-02 17:21:35 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/10821121/4002
8 years, 4 months ago (2012-08-02 17:21:49 UTC) #8
commit-bot: I haz the power
Try job failure for 10821121-4002 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 4 months ago (2012-08-02 18:04:52 UTC) #9
tim (not reviewing)
On 2012/08/02 18:04:52, I haz the power (commit-bot) wrote: > Try job failure for 10821121-4002 ...
8 years, 4 months ago (2012-08-02 19:40:50 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/10821121/17001
8 years, 4 months ago (2012-08-07 22:43:13 UTC) #11
commit-bot: I haz the power
8 years, 4 months ago (2012-08-08 00:10:18 UTC) #12
Change committed as 150465

Powered by Google App Engine
This is Rietveld 408576698