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

Issue 10451060: sync: migrate invalidation state from syncable::Directory to InvalidationStorage (Closed)

Created:
8 years, 6 months ago by tim (not reviewing)
Modified:
8 years, 6 months ago
Reviewers:
Nicolas Zea, akalin, nilesh
CC:
chromium-reviews, Raghu Simha, ncarter (slow), pam+watch_chromium.org, akalin, tim (not reviewing)
Visibility:
Public.

Description

sync: migrate invalidation state from syncable::Directory to InvalidationStorage Deprecates SyncNotifier::SetState, as this is needed only to plumb notification state from the syncable::Directory to notifier. It is still in use to facilitate migration. Migration for an existing sync setup works as follows: 1) normal SyncManager::Init occurs, which calls SetState on notifier. 2) The InvalidationNotifier takes the state received in SetState and echoes it back through the InvalidationStateTracker) which is the new store. It does this in addition to normal stashing, to hand to ChromeInvalidationClient when needed. 3) On a subsequent restart, the SyncNotifierFactory will see a non-empty initial invalidation state in the InvalidationStateTracker, and pass this down on creation to notifier components. 4) SetState calls will now be no-ops, as the invalidation state will be non-empty, and it can only be set once on this code path. UMA tracks the number of "worthwhile" SetStateDeprecated calls for a rough global migration progress. At some point in the future, once these bits have served all (statistically speaking) users, the SetStateDeprecated call can be removed entirely and the syncable::Directory schema updated to remove existing and unnecessary columns. I did not remove the column from DirectoryBackingStore::CreateTables, since the code doesn't really support a half-way migration and it's likely cleaner to do it in one fell swoop when we know it is safe. Open to suggestions. Built on http://codereview.chromium.org/10451058/ BUG=124140 TEST= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=139706

Patch Set 1 : init #

Total comments: 3

Patch Set 2 : add migration test #

Patch Set 3 : rebase #

Patch Set 4 : base64 #

Total comments: 1

Patch Set 5 : tracker cc #

Patch Set 6 : include order #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -136 lines) Patch
M chrome/browser/sync/glue/bridged_sync_notifier.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/bridged_sync_notifier.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/sync/invalidations/invalidator_storage.cc View 1 2 3 2 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/sync/invalidations/invalidator_storage_unittest.cc View 1 2 3 4 5 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/sync_manager.cc View 1 2 3 chunks +3 lines, -20 lines 0 comments Download
M sync/internal_api/syncapi_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M sync/notifier/chrome_invalidation_client.h View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M sync/notifier/chrome_invalidation_client.cc View 1 2 6 chunks +4 lines, -10 lines 0 comments Download
M sync/notifier/chrome_invalidation_client_unittest.cc View 1 2 6 chunks +9 lines, -18 lines 0 comments Download
M sync/notifier/invalidation_notifier.h View 1 2 5 chunks +5 lines, -7 lines 0 comments Download
M sync/notifier/invalidation_notifier.cc View 1 2 6 chunks +21 lines, -10 lines 0 comments Download
M sync/notifier/invalidation_notifier_unittest.cc View 1 2 5 chunks +40 lines, -8 lines 0 comments Download
M sync/notifier/invalidation_state_tracker.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A sync/notifier/mock_invalidation_state_tracker.h View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
A sync/notifier/mock_invalidation_state_tracker.cc View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
M sync/notifier/mock_sync_notifier_observer.h View 1 chunk +0 lines, -1 line 0 comments Download
M sync/notifier/non_blocking_invalidation_notifier.h View 3 chunks +2 lines, -2 lines 0 comments Download
M sync/notifier/non_blocking_invalidation_notifier.cc View 1 2 9 chunks +13 lines, -21 lines 0 comments Download
M sync/notifier/non_blocking_invalidation_notifier_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M sync/notifier/p2p_notifier.h View 1 chunk +1 line, -1 line 0 comments Download
M sync/notifier/p2p_notifier.cc View 1 chunk +1 line, -1 line 0 comments Download
M sync/notifier/sync_notifier.h View 2 chunks +2 lines, -2 lines 0 comments Download
M sync/notifier/sync_notifier_factory.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/notifier/sync_notifier_factory.cc View 4 chunks +7 lines, -1 line 0 comments Download
M sync/notifier/sync_notifier_observer.h View 1 chunk +0 lines, -4 lines 0 comments Download
M sync/sync.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M sync/tools/sync_listen_notifications.cc View 1 2 2 chunks +0 lines, -7 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
tim (not reviewing)
Nicolas / Nilesh, I think having you both review all would be ideal! It's not ...
8 years, 6 months ago (2012-05-29 17:56:09 UTC) #1
nilesh
LGTM Disclaimer: I dont understand a lot of this :) nzea would be able to ...
8 years, 6 months ago (2012-05-29 23:01:36 UTC) #2
Nicolas Zea
Mostly LG https://chromiumcodereview.appspot.com/10451060/diff/5025/sync/notifier/invalidation_notifier_unittest.cc File sync/notifier/invalidation_notifier_unittest.cc (right): https://chromiumcodereview.appspot.com/10451060/diff/5025/sync/notifier/invalidation_notifier_unittest.cc#newcode40 sync/notifier/invalidation_notifier_unittest.cc:40: base::WeakPtr<InvalidationStateTracker>()), Seems like this would be a ...
8 years, 6 months ago (2012-05-29 23:32:53 UTC) #3
tim (not reviewing)
https://chromiumcodereview.appspot.com/10451060/diff/5025/sync/notifier/invalidation_notifier_unittest.cc File sync/notifier/invalidation_notifier_unittest.cc (right): https://chromiumcodereview.appspot.com/10451060/diff/5025/sync/notifier/invalidation_notifier_unittest.cc#newcode40 sync/notifier/invalidation_notifier_unittest.cc:40: base::WeakPtr<InvalidationStateTracker>()), On 2012/05/29 23:32:53, nzea wrote: > Seems like ...
8 years, 6 months ago (2012-05-30 02:02:47 UTC) #4
Nicolas Zea
LGTM
8 years, 6 months ago (2012-05-30 17:14:57 UTC) #5
tim (not reviewing)
Rebased with Fred's PushClient change, and also added code + test to InvalidatorStorage to encode ...
8 years, 6 months ago (2012-05-30 21:46:14 UTC) #6
Nicolas Zea
LGTM http://codereview.chromium.org/10451060/diff/14001/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc File chrome/browser/sync/invalidations/invalidator_storage_unittest.cc (right): http://codereview.chromium.org/10451060/diff/14001/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc#newcode8 chrome/browser/sync/invalidations/invalidator_storage_unittest.cc:8: #include "base/string_util.h" abc order
8 years, 6 months ago (2012-05-30 22:39:58 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/10451060/14003
8 years, 6 months ago (2012-05-30 23:17:13 UTC) #8
commit-bot: I haz the power
8 years, 6 months ago (2012-05-31 00:34:43 UTC) #9
Try job failure for 10451060-14003 (retry) on win_rel for step "compile"
(clobber build).
It's a second try, previously, step "compile" failed.
http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&nu...

Powered by Google App Engine
This is Rietveld 408576698