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

Issue 7655055: [Sync] Make BackendMigrator not wait for full sync cycles (Closed)

Created:
9 years, 4 months ago by akalin
Modified:
9 years, 3 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), Paweł Hajdan Jr., idana
Visibility:
Public.

Description

[Sync] Make BackendMigrator not wait for full sync cycles Make sure that scheduling data type cleanup before scheduling start implies that the cleanup happes before the start. Make BackendMigrator simply wait for configuration to be done, since data type cleanup is done before configuration. Make BackendMigrator always preempt any existing migration. Make DataTypeManagerImpl configuration handle being preempted with enable_nigori set (since BackendMigrator can now do that). Make DataTypeManagerImpl check for pending reconfigure on DownloadReady, ignoring download success if so (since a migration may cause a download failure, now that we don't wait for a full sync cycle). Re-enable and rewrite failing MigrationCycle tests. Fix subtle bug in SyncBackendHost where types_to_remove is used where types_to_remove_with_nigori should be used instead. Make syncer_end_command propagate up all download progress markers, as that is needed by migration tests. Add integration test methods for migration. BUG=92928 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99265

Patch Set 1 #

Patch Set 2 : Actually re-enable tests #

Total comments: 3

Patch Set 3 : Fix unit tests #

Patch Set 4 : Sync to head #

Total comments: 10

Patch Set 5 : Address Tim's comments #

Patch Set 6 : Fix braces #

Patch Set 7 : Fix race condition #

Total comments: 5

Patch Set 8 : Fix race condition in simpler way #

Patch Set 9 : Got working again #

Patch Set 10 : fix test failures #

Patch Set 11 : Fix mock #

Patch Set 12 : fix win compile error #

Patch Set 13 : Fix mac test #

Total comments: 4

Patch Set 14 : Address comments #

Patch Set 15 : Cleanup #

Total comments: 21

Patch Set 16 : Addressed Tim's comments #

Total comments: 4

Patch Set 17 : Addressed rsimha's comments #

Total comments: 4

Patch Set 18 : Address more comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1176 lines, -715 lines) Patch
M chrome/browser/sync/backend_migrator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +55 lines, -17 lines 0 comments Download
M chrome/browser/sync/backend_migrator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +158 lines, -87 lines 0 comments Download
M chrome/browser/sync/backend_migrator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +111 lines, -99 lines 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +7 lines, -10 lines 0 comments Download
M chrome/browser/sync/engine/sync_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer_end_command.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/engine/syncer_proto_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl.h View 1 2 3 4 5 6 2 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl.cc View 1 2 3 4 5 6 7 9 10 11 12 13 5 chunks +39 lines, -31 lines 0 comments Download
M chrome/browser/sync/glue/data_type_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 16 chunks +169 lines, -113 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -4 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 17 chunks +45 lines, -23 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar.cc View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_registrar_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +5 lines, -8 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +10 lines, -8 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 9 chunks +34 lines, -15 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 chunks +159 lines, -18 lines 0 comments Download
M chrome/browser/sync/sessions/sync_session.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/live_sync/live_sync_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/test/live_sync/live_sync_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +10 lines, -2 lines 0 comments Download
M chrome/test/live_sync/migration_errors_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +312 lines, -263 lines 0 comments Download
M chrome/test/sync/engine/test_user_share.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 46 (0 generated)
akalin
+tim/lingesh for review Also, opinions on whether this fix (if LGTMed) is safe to merge ...
9 years, 4 months ago (2011-08-19 00:14:22 UTC) #1
akalin
http://codereview.chromium.org/7655055/diff/1011/chrome/browser/sync/glue/data_type_manager_impl.cc File chrome/browser/sync/glue/data_type_manager_impl.cc (right): http://codereview.chromium.org/7655055/diff/1011/chrome/browser/sync/glue/data_type_manager_impl.cc#newcode265 chrome/browser/sync/glue/data_type_manager_impl.cc:265: // Ignore |success| if we need to reconfigure anyway. ...
9 years, 4 months ago (2011-08-19 01:34:27 UTC) #2
tim (not reviewing)
Adding Nicolas for DataTypeManagerImpl changes.
9 years, 4 months ago (2011-08-22 14:44:06 UTC) #3
tim (not reviewing)
http://codereview.chromium.org/7655055/diff/5001/chrome/browser/sync/backend_migrator.cc File chrome/browser/sync/backend_migrator.cc (left): http://codereview.chromium.org/7655055/diff/5001/chrome/browser/sync/backend_migrator.cc#oldcode104 chrome/browser/sync/backend_migrator.cc:104: if (num_empty_migrated_markers < to_migrate_.size()) Is there a way we ...
9 years, 4 months ago (2011-08-22 15:08:49 UTC) #4
Nicolas Zea
DTM changes LGTM
9 years, 4 months ago (2011-08-22 18:43:56 UTC) #5
akalin
All comments addressed, PTAL http://codereview.chromium.org/7655055/diff/5001/chrome/browser/sync/backend_migrator.cc File chrome/browser/sync/backend_migrator.cc (right): http://codereview.chromium.org/7655055/diff/5001/chrome/browser/sync/backend_migrator.cc#newcode40 chrome/browser/sync/backend_migrator.cc:40: using std::swap; On 2011/08/22 15:08:49, ...
9 years, 4 months ago (2011-08-24 22:50:17 UTC) #6
akalin
http://codereview.chromium.org/7655055/diff/5001/chrome/browser/sync/backend_migrator.cc File chrome/browser/sync/backend_migrator.cc (left): http://codereview.chromium.org/7655055/diff/5001/chrome/browser/sync/backend_migrator.cc#oldcode104 chrome/browser/sync/backend_migrator.cc:104: if (num_empty_migrated_markers < to_migrate_.size()) On 2011/08/22 15:08:49, timsteele wrote: ...
9 years, 4 months ago (2011-08-24 22:55:01 UTC) #7
lipalani1
LGTM from my side!!(I only reviewed the logic not the style). Looks like pretty much ...
9 years, 4 months ago (2011-08-24 23:26:29 UTC) #8
akalin
On 2011/08/24 23:26:29, lipalani1 wrote: > LGTM from my side!!(I only reviewed the logic not ...
9 years, 4 months ago (2011-08-24 23:43:45 UTC) #9
akalin
On 2011/08/24 23:43:45, akalin wrote: > On 2011/08/24 23:26:29, lipalani1 wrote: > > LGTM from ...
9 years, 4 months ago (2011-08-25 03:13:33 UTC) #10
akalin
I added a method to check the progress markers directly. This ended up revealing a ...
9 years, 4 months ago (2011-08-26 00:23:33 UTC) #11
tim (not reviewing)
Few more comments. Hang in there... Would be good for Lingesh to peek at the ...
9 years, 4 months ago (2011-08-26 12:41:40 UTC) #12
akalin
http://codereview.chromium.org/7655055/diff/22025/chrome/browser/sync/glue/sync_backend_host.cc#newcode376 > chrome/browser/sync/glue/sync_backend_host.cc:376: > trans.GetLookup()->GetDownloadProgress(type, &progress_marker); > I like the GetDownloadProgress approach, but want to ...
9 years, 4 months ago (2011-08-26 17:19:18 UTC) #13
lipalani1
Fred - I am trying to understand the need for callback(although I agree with having ...
9 years, 4 months ago (2011-08-26 21:34:03 UTC) #14
akalin
On Sat, Aug 27, 2011 at 5:34 AM, <lipalani@chromium.org> wrote: > Fred - I am ...
9 years, 4 months ago (2011-08-26 21:40:05 UTC) #15
lipalani1
ah.. it bites us. the impl functions were an artifact of multiple threads. I was ...
9 years, 4 months ago (2011-08-26 21:48:58 UTC) #16
akalin
On Sat, Aug 27, 2011 at 5:48 AM, <lipalani@chromium.org> wrote: > ah.. it bites us. ...
9 years, 4 months ago (2011-08-26 21:55:28 UTC) #17
akalin
Okay, I reverted my changes to plumb the closure through, and instead made ScheduleCleanupDisabledTypes directly ...
9 years, 4 months ago (2011-08-27 00:55:29 UTC) #18
akalin
On 2011/08/27 00:55:29, akalin wrote: > Okay, I reverted my changes to plumb the closure ...
9 years, 3 months ago (2011-08-27 06:57:48 UTC) #19
akalin
Okay, this is finally ready for another look. Raghu: please take a look at the ...
9 years, 3 months ago (2011-08-31 06:54:12 UTC) #20
Nicolas Zea
http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/data_type_manager_impl.h File chrome/browser/sync/glue/data_type_manager_impl.h (right): http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/data_type_manager_impl.h#newcode100 chrome/browser/sync/glue/data_type_manager_impl.h:100: bool last_enable_nigori_; Is it possible to determine this based ...
9 years, 3 months ago (2011-08-31 17:34:27 UTC) #21
akalin
http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/data_type_manager_impl.h File chrome/browser/sync/glue/data_type_manager_impl.h (right): http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/data_type_manager_impl.h#newcode100 chrome/browser/sync/glue/data_type_manager_impl.h:100: bool last_enable_nigori_; On 2011/08/31 17:34:27, nzea wrote: > Is ...
9 years, 3 months ago (2011-08-31 21:15:50 UTC) #22
Nicolas Zea
Bleh. Alright, LGTM.
9 years, 3 months ago (2011-08-31 21:35:43 UTC) #23
akalin
On 2011/08/31 21:35:43, nzea wrote: > Bleh. Alright, LGTM. Tim/Raghu/Lingesh?
9 years, 3 months ago (2011-08-31 22:10:20 UTC) #24
lipalani
i am reviewing now. will let you know by eod. On Wed, Aug 31, 2011 ...
9 years, 3 months ago (2011-08-31 22:20:24 UTC) #25
tim (not reviewing)
one comment, LGTM pending Lingesh's review. http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/sync_backend_registrar.h File chrome/browser/sync/glue/sync_backend_registrar.h (right): http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/sync_backend_registrar.h#newcode39 chrome/browser/sync/glue/sync_backend_registrar.h:39: const std::string& name, ...
9 years, 3 months ago (2011-08-31 23:18:01 UTC) #26
akalin
Talked with Lingesh offline. His comments: - Is it necessary for the DTM/SBH to handle ...
9 years, 3 months ago (2011-08-31 23:56:28 UTC) #27
akalin
http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/sync_backend_registrar.h File chrome/browser/sync/glue/sync_backend_registrar.h (right): http://codereview.chromium.org/7655055/diff/36117/chrome/browser/sync/glue/sync_backend_registrar.h#newcode39 chrome/browser/sync/glue/sync_backend_registrar.h:39: const std::string& name, On 2011/08/31 23:18:02, timsteele wrote: > ...
9 years, 3 months ago (2011-09-01 01:38:39 UTC) #28
akalin
On 2011/08/31 23:56:28, akalin wrote: > Talked with Lingesh offline. His comments: > > - ...
9 years, 3 months ago (2011-09-01 01:40:32 UTC) #29
akalin
Addressed all comments, please take another look. Or if no one looks at it before ...
9 years, 3 months ago (2011-09-01 01:41:06 UTC) #30
tim (not reviewing)
This sure got complicated :\ You'll have to talk to Anna about re-running the full ...
9 years, 3 months ago (2011-09-01 01:50:55 UTC) #31
lipalani
Can you make the harness post a task to query the migrator. On Aug 31, ...
9 years, 3 months ago (2011-09-01 01:51:50 UTC) #32
akalin
On 2011/09/01 01:51:50, lipalani wrote: > Can you make the harness post a task to ...
9 years, 3 months ago (2011-09-01 02:15:07 UTC) #33
akalin
I'd like opinions on what I should do before I make more changes, as I'm ...
9 years, 3 months ago (2011-09-01 02:19:39 UTC) #34
akalin
On 2011/09/01 01:50:55, timsteele wrote: > This sure got complicated :\ > You'll have to ...
9 years, 3 months ago (2011-09-01 02:23:39 UTC) #35
tim (not reviewing)
On 2011/09/01 02:23:39, akalin wrote: > On 2011/09/01 01:50:55, timsteele wrote: > > This sure ...
9 years, 3 months ago (2011-09-01 02:36:22 UTC) #36
akalin
Okay, addressed all comments. Please take another look! http://codereview.chromium.org/7655055/diff/41012/chrome/browser/sync/backend_migrator.cc File chrome/browser/sync/backend_migrator.cc (right): http://codereview.chromium.org/7655055/diff/41012/chrome/browser/sync/backend_migrator.cc#newcode150 chrome/browser/sync/backend_migrator.cc:150: syncable::ModelTypeSet ...
9 years, 3 months ago (2011-09-01 03:39:50 UTC) #37
Raghu Simha
http://codereview.chromium.org/7655055/diff/41012/chrome/browser/sync/profile_sync_service_harness.cc File chrome/browser/sync/profile_sync_service_harness.cc (right): http://codereview.chromium.org/7655055/diff/41012/chrome/browser/sync/profile_sync_service_harness.cc#newcode227 chrome/browser/sync/profile_sync_service_harness.cc:227: // |pending_migration_types_|. Should we not simply replace pending_migration_types_ with ...
9 years, 3 months ago (2011-09-01 03:53:06 UTC) #38
akalin
PTAL http://codereview.chromium.org/7655055/diff/41012/chrome/browser/sync/profile_sync_service_harness.cc File chrome/browser/sync/profile_sync_service_harness.cc (right): http://codereview.chromium.org/7655055/diff/41012/chrome/browser/sync/profile_sync_service_harness.cc#newcode227 chrome/browser/sync/profile_sync_service_harness.cc:227: // |pending_migration_types_|. On 2011/09/01 03:53:06, rsimha wrote: > ...
9 years, 3 months ago (2011-09-01 04:03:23 UTC) #39
Raghu Simha
The migration tests seem to have been beefed up really nicely in this patch. All ...
9 years, 3 months ago (2011-09-01 04:23:58 UTC) #40
lipalani1
This looks good. I think having usershare there is cleaner but it is possible my ...
9 years, 3 months ago (2011-09-01 04:37:07 UTC) #41
tim (not reviewing)
LGTM On Wed, Aug 31, 2011 at 9:37 PM, <lipalani@chromium.org> wrote: > This looks good. ...
9 years, 3 months ago (2011-09-01 04:38:42 UTC) #42
akalin
http://codereview.chromium.org/7655055/diff/49001/chrome/browser/sync/profile_sync_service_harness.cc File chrome/browser/sync/profile_sync_service_harness.cc (right): http://codereview.chromium.org/7655055/diff/49001/chrome/browser/sync/profile_sync_service_harness.cc#newcode187 chrome/browser/sync/profile_sync_service_harness.cc:187: // (possible only choosing data types). On 2011/09/01 04:23:58, ...
9 years, 3 months ago (2011-09-01 04:39:05 UTC) #43
akalin
On Wed, Aug 31, 2011 at 9:23 PM, <rsimha@chromium.org> wrote: > The migration tests seem ...
9 years, 3 months ago (2011-09-01 04:43:22 UTC) #44
akalin
Landing this after trybots pass! I will talk with Anna re. migration test pass tomorrow.
9 years, 3 months ago (2011-09-01 04:44:47 UTC) #45
commit-bot: I haz the power
9 years, 3 months ago (2011-09-01 07:42:21 UTC) #46
Presubmit check for 7655055-51002 failed and returned exit status 1.

Running presubmit commit checks ...

** Presubmit Messages **
If this change requires manual test instructions to QA team, add
TEST=[instructions].

** Presubmit Warnings **
You might be calling functions intended only for testing from
production code. Please verify that the following usages are OK,
and email joi@chromium.org if you are seeing false positives:
  chrome/browser/sync/profile_sync_service_harness.cc:224
    service_->GetBackendMigratorForTest(); \
  chrome/browser/sync/profile_sync_service_harness.cc:429
    service()->GetBackendMigratorForTest()-> \
  chrome/browser/sync/profile_sync_service_harness.cc:430
    GetPendingMigrationTypesForTest(); \
  chrome/browser/sync/profile_sync_service_harness.cc:747
    service()->GetBackendMigratorForTest();

Presubmit checks took 5.7s to calculate.

Powered by Google App Engine
This is Rietveld 408576698