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

Issue 11474036: Remove initial_sync_ended bits (Closed)

Created:
8 years ago by rlarocque
Modified:
8 years ago
CC:
chromium-reviews, Raghu Simha, haitaol1, akalin, tim (not reviewing)
Visibility:
Public.

Description

Remove initial_sync_ended bits As of crbug.com/164288, we can no longer trust initial_sync_ended. If my diagnosis is correct, then there are some clients out there who have their initial_sync_ended bits set for some data types which have not actually been synced. Those clients now crash at every startup. This change attempts to solve the problem by removing the separate initial_sync_ended array of bools and checking the database directly to learn of a type's status. The new definition of initial_sync_ended is that a type has finished initial sync if its top level folder has been downloaded and applied. To prevent crashing if the server decides to not send us those root nodes during the control types configure step, we now check that all control types are initial_sync_ended following that configure and fail gracefully if their initial sync is not completed. The new definition of initial_sync_ended makes it much easier to hit crbug.com/164914. That bug would prevent us from saving our changes following a call to PurgeEntriesWithTypeIn() in some situations. This commit also fixes that bug. Since the initial sync ended status is no longer independent from the database state, it is no longer necessary to collect debug info as to its status. It has been removed from the about:sync UI and other debug info reporting mechanisms. Its role in unit tests has also been greatly reduced. BUG=164288, 164914 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172707

Patch Set 1 #

Patch Set 2 : Avoid spurious changes #

Total comments: 14

Patch Set 3 : Review fixes #

Total comments: 2

Patch Set 4 : Test control type download failure #

Total comments: 1

Patch Set 5 : Add another test #

Total comments: 2

Patch Set 6 : Rebase and test cleanups #

Total comments: 1

Patch Set 7 : Fix minor bug in comment #

Patch Set 8 : Another rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+565 lines, -307 lines) Patch
M chrome/browser/sync/about_sync_util.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 3 chunks +16 lines, -7 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 2 3 4 5 17 chunks +29 lines, -17 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 chunks +3 lines, -15 lines 0 comments Download
M sync/engine/all_status.cc View 3 chunks +0 lines, -4 lines 0 comments Download
M sync/engine/apply_control_data_updates.cc View 1 chunk +0 lines, -11 lines 0 comments Download
M sync/engine/apply_control_data_updates_unittest.cc View 14 chunks +0 lines, -22 lines 0 comments Download
M sync/engine/apply_updates_and_resolve_conflicts_command.cc View 1 chunk +0 lines, -14 lines 0 comments Download
M sync/engine/syncer_unittest.cc View 4 chunks +0 lines, -12 lines 0 comments Download
M sync/internal_api/js_sync_manager_observer_unittest.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M sync/internal_api/public/engine/sync_status.h View 1 chunk +0 lines, -2 lines 0 comments Download
M sync/internal_api/public/engine/sync_status.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sync/internal_api/public/sessions/sync_session_snapshot.h View 1 2 3 4 5 6 7 3 chunks +0 lines, -6 lines 0 comments Download
M sync/internal_api/public/sessions/sync_session_snapshot.cc View 5 chunks +1 line, -17 lines 0 comments Download
M sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc View 4 chunks +1 line, -12 lines 0 comments Download
M sync/internal_api/public/test/test_entry_factory.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 11 chunks +74 lines, -53 lines 0 comments Download
M sync/internal_api/test/test_entry_factory.cc View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
M sync/internal_api/test/test_user_share.cc View 2 chunks +2 lines, -20 lines 0 comments Download
M sync/sessions/sync_session.cc View 2 chunks +0 lines, -10 lines 0 comments Download
M sync/syncable/directory.h View 1 2 3 4 5 6 7 3 chunks +3 lines, -6 lines 0 comments Download
M sync/syncable/directory.cc View 3 chunks +22 lines, -24 lines 0 comments Download
M sync/syncable/directory_backing_store.h View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M sync/syncable/directory_backing_store.cc View 1 2 3 4 5 6 13 chunks +48 lines, -29 lines 0 comments Download
M sync/syncable/directory_backing_store_unittest.cc View 1 2 3 4 5 7 chunks +272 lines, -3 lines 0 comments Download
M sync/syncable/syncable_unittest.cc View 9 chunks +14 lines, -15 lines 0 comments Download
M sync/test/engine/test_syncable_utils.h View 2 chunks +8 lines, -0 lines 0 comments Download
M sync/test/engine/test_syncable_utils.cc View 2 chunks +27 lines, -0 lines 0 comments Download
M sync/test/test_directory_backing_store.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
rlarocque
Please review.
8 years ago (2012-12-07 22:39:04 UTC) #1
Nicolas Zea
Describe crbug.com/164914 in commit message too? https://codereview.chromium.org/11474036/diff/2001/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): https://codereview.chromium.org/11474036/diff/2001/chrome/browser/sync/glue/sync_backend_host.cc#newcode682 chrome/browser/sync/glue/sync_backend_host.cc:682: // until they ...
8 years ago (2012-12-10 22:50:38 UTC) #2
tim (not reviewing)
https://codereview.chromium.org/11474036/diff/2001/sync/internal_api/public/sessions/sync_session_snapshot.h File sync/internal_api/public/sessions/sync_session_snapshot.h (left): https://codereview.chromium.org/11474036/diff/2001/sync/internal_api/public/sessions/sync_session_snapshot.h#oldcode34 sync/internal_api/public/sessions/sync_session_snapshot.h:34: bool is_share_usable, On 2012/12/10 22:50:38, Nicolas Zea wrote: > ...
8 years ago (2012-12-10 23:05:36 UTC) #3
rlarocque
Patch and commit message updated. PTAL. https://codereview.chromium.org/11474036/diff/2001/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): https://codereview.chromium.org/11474036/diff/2001/chrome/browser/sync/glue/sync_backend_host.cc#newcode682 chrome/browser/sync/glue/sync_backend_host.cc:682: // until they ...
8 years ago (2012-12-11 01:44:48 UTC) #4
Nicolas Zea
https://codereview.chromium.org/11474036/diff/9001/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): https://codereview.chromium.org/11474036/diff/9001/chrome/browser/sync/glue/sync_backend_host.cc#newcode1242 chrome/browser/sync/glue/sync_backend_host.cc:1242: if (!sync_manager_->InitialSyncEndedTypes().HasAll(syncer::ControlTypes())) { Could you add a unit test ...
8 years ago (2012-12-11 02:12:40 UTC) #5
rlarocque
Patch updated with a new unit test. PTAL. https://codereview.chromium.org/11474036/diff/9001/chrome/browser/sync/glue/sync_backend_host.cc File chrome/browser/sync/glue/sync_backend_host.cc (right): https://codereview.chromium.org/11474036/diff/9001/chrome/browser/sync/glue/sync_backend_host.cc#newcode1242 chrome/browser/sync/glue/sync_backend_host.cc:1242: if ...
8 years ago (2012-12-11 19:23:03 UTC) #6
Nicolas Zea
https://codereview.chromium.org/11474036/diff/18001/chrome/browser/sync/profile_sync_service_unittest.cc File chrome/browser/sync/profile_sync_service_unittest.cc (right): https://codereview.chromium.org/11474036/diff/18001/chrome/browser/sync/profile_sync_service_unittest.cc#newcode429 chrome/browser/sync/profile_sync_service_unittest.cc:429: harness_.StartSyncServiceAndSetInitialSyncEnded(false, true, true, true, I'd prefer having this test ...
8 years ago (2012-12-11 19:35:00 UTC) #7
rlarocque
Added another test. PTAL.
8 years ago (2012-12-11 22:59:33 UTC) #8
Nicolas Zea
Thanks, LGTM
8 years ago (2012-12-11 23:12:36 UTC) #9
rlarocque
The rebase had a lot of conflict, particularly in directory_backing_store.cc and directory_backing_store_unittest.cc. I think the ...
8 years ago (2012-12-12 01:19:16 UTC) #10
Nicolas Zea
lgtm
8 years ago (2012-12-12 22:03:55 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11474036/31004
8 years ago (2012-12-12 22:11:10 UTC) #12
commit-bot: I haz the power
8 years ago (2012-12-12 23:53:21 UTC) #13
Message was sent while issue was closed.
Change committed as 172707

Powered by Google App Engine
This is Rietveld 408576698