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

Issue 11192071: sync: Merge apply updates and resolve conflicts (Closed)

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

Description

sync: Merge apply updates and resolve conflicts The conflict resolution code was executed after the commit for reasons which no longer apply. Because we no longer have to worry about resolving hierarchy conflicts or nigori node conflicts, we have the opportunity to move conflict resolution closer to update application. One advantage of resolving conflicts early is that we no longer require an extra sync cycle to commit any 'local wins' conflict resolutions. This makes SYNC_CYCLE_CONTINUATION sync cycles obsolete. Another advantage is that update application and conflict resolution can be performed without releasing the sync lock, which eliminates several types of races that we used to have to worry about. It's probably more efficient, too. It allows us to guarantee that there are no simple conflicts remaining after the update application step is completed. The effects might not be very noticeable to end users, but it will be nice to remove some of the conflict tracking code. Finally, it removes the last use PerModelSafeGroupState. This will let us delete some unused code and hopefully simplify StatusController. This patch does not pursue these cleanups as agressively as it could. The idea here is to keep the complex logic changes in one small CL, and perform the cleanups in a larger, but simpler, follow-up CL. BUG=147681, 11280, 156238 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=164286

Patch Set 1 #

Total comments: 7

Patch Set 2 : Big rename + small typo fix #

Patch Set 3 : Detect renames correctly this time #

Patch Set 4 : Rebase #

Patch Set 5 : Another rebase #

Patch Set 6 : Retry (base files were missing) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+225 lines, -940 lines) Patch
A + sync/engine/apply_updates_and_resolve_conflicts_command.h View 1 2 2 chunks +8 lines, -8 lines 0 comments Download
A + sync/engine/apply_updates_and_resolve_conflicts_command.cc View 1 2 5 chunks +67 lines, -12 lines 0 comments Download
A + sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc View 1 15 chunks +53 lines, -72 lines 0 comments Download
D sync/engine/apply_updates_command.h View 1 1 chunk +0 lines, -31 lines 0 comments Download
D sync/engine/apply_updates_command.cc View 1 1 chunk +0 lines, -93 lines 0 comments Download
D sync/engine/apply_updates_command_unittest.cc View 1 1 chunk +0 lines, -438 lines 0 comments Download
M sync/engine/conflict_resolver.h View 1 chunk +2 lines, -7 lines 0 comments Download
M sync/engine/conflict_resolver.cc View 1 2 3 4 7 chunks +17 lines, -29 lines 0 comments Download
D sync/engine/resolve_conflicts_command.h View 1 chunk +0 lines, -32 lines 0 comments Download
D sync/engine/resolve_conflicts_command.cc View 1 chunk +0 lines, -42 lines 0 comments Download
M sync/engine/sync_scheduler_unittest.cc View 1 chunk +0 lines, -30 lines 0 comments Download
M sync/engine/syncer.h View 1 chunk +0 lines, -2 lines 0 comments Download
M sync/engine/syncer.cc View 1 5 chunks +2 lines, -42 lines 0 comments Download
M sync/engine/syncer_proto_util_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sync/engine/syncer_unittest.cc View 1 2 3 9 chunks +13 lines, -24 lines 0 comments Download
M sync/engine/update_applicator.h View 3 chunks +22 lines, -4 lines 0 comments Download
M sync/engine/update_applicator.cc View 5 chunks +17 lines, -14 lines 0 comments Download
M sync/internal_api/debug_info_event_listener.h View 1 chunk +0 lines, -1 line 0 comments Download
M sync/internal_api/debug_info_event_listener.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M sync/internal_api/js_sync_manager_observer.cc View 1 chunk +0 lines, -1 line 0 comments Download
M sync/sessions/status_controller.h View 2 chunks +5 lines, -3 lines 0 comments Download
M sync/sessions/status_controller.cc View 2 chunks +12 lines, -8 lines 0 comments Download
M sync/sessions/status_controller_unittest.cc View 2 chunks +4 lines, -39 lines 0 comments Download
M sync/sync.gyp View 1 3 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
rlarocque
I'm fairly confident that the merge itself is safe. I'm less sure about my assertion ...
8 years, 2 months ago (2012-10-18 23:14:50 UTC) #1
Nicolas Zea
Nice! The logic in apply updates command looks good.
8 years, 2 months ago (2012-10-23 00:55:46 UTC) #2
rlarocque
On 2012/10/23 00:55:46, nzea wrote: > Nice! > > The logic in apply updates command ...
8 years, 2 months ago (2012-10-24 17:08:30 UTC) #3
tim (not reviewing)
The logic overall looks good, just some nits and a rename suggestion. http://codereview.chromium.org/11192071/diff/1/sync/engine/apply_updates_command.cc File sync/engine/apply_updates_command.cc ...
8 years, 2 months ago (2012-10-24 20:29:08 UTC) #4
rlarocque
New patch uploaded. PTAL. http://codereview.chromium.org/11192071/diff/1/sync/engine/apply_updates_command.cc File sync/engine/apply_updates_command.cc (right): http://codereview.chromium.org/11192071/diff/1/sync/engine/apply_updates_command.cc#newcode83 sync/engine/apply_updates_command.cc:83: // Resolve the simple conflicts ...
8 years, 2 months ago (2012-10-24 21:21:22 UTC) #5
tim (not reviewing)
LGTM http://codereview.chromium.org/11192071/diff/1/sync/engine/apply_updates_command.cc File sync/engine/apply_updates_command.cc (right): http://codereview.chromium.org/11192071/diff/1/sync/engine/apply_updates_command.cc#newcode83 sync/engine/apply_updates_command.cc:83: // Resolve the simple conflicts we just detected. ...
8 years, 2 months ago (2012-10-24 22:34:24 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11192071/11001
8 years, 2 months ago (2012-10-24 22:47:52 UTC) #7
commit-bot: I haz the power
Failed to apply patch for sync/engine/conflict_resolver.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 2 months ago (2012-10-24 22:47:59 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11192071/14001
8 years, 1 month ago (2012-10-25 20:22:49 UTC) #9
commit-bot: I haz the power
Failed to apply patch for sync/engine/conflict_resolver.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years, 1 month ago (2012-10-25 20:22:57 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/11192071/12003
8 years, 1 month ago (2012-10-25 21:47:35 UTC) #11
commit-bot: I haz the power
Retried try job too often for step(s) interactive_ui_tests
8 years, 1 month ago (2012-10-26 01:05:55 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11192071/12003
8 years, 1 month ago (2012-10-26 01:21:36 UTC) #13
commit-bot: I haz the power
8 years, 1 month ago (2012-10-26 07:53:19 UTC) #14
Change committed as 164286

Powered by Google App Engine
This is Rietveld 408576698