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

Issue 2958303002: [Sync] Maintain a global_id mapping to update UserEvents that references navigations (Closed)

Created:
3 years, 5 months ago by skym
Modified:
3 years, 5 months ago
CC:
chromium-reviews, ios-reviews+chrome_chromium.org, ios-reviews_chromium.org, noyau+watch_chromium.org, asvitkine+watch_chromium.org, marq+watch_chromium.org, sync-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Maintain a global_id mapping to update UserEvents that references navigations. UserEvents are created and reference sessions data by global_id. It is important that they travel over the wire in this format, as this is how the sessions data is keyed into Footprints, and the sync server cannot feasibly perform a persistent read before writing new UserEvents. Because global_id is forced to be part of the wire interface and specifics, it is also conveniently part of the interface to the UserEventService. However, while this global_id is seemingly sacred to sync, it comes from simply the timestmap of the navigation entry. And if a page is reloaded, this value can change. A problem arises when a UserEvent references a navigation by a global_id that was updated and the old value is never going to reach the sync server. To fix we maintain two sets of mappings, one that allows us to map old global_ids to new global_id, and one that allows us to efficiently look up uncommitted UserEvents by global_id, so that if we get either a new global_id or a new UserEvent we can quickly fix the global_id. BUG=747621 Review-Url: https://codereview.chromium.org/2958303002 Cr-Commit-Position: refs/heads/master@{#488826} Committed: https://chromium.googlesource.com/chromium/src/+/a58a1f014663671847efd294313b99fe71e1a6bf

Patch Set 1 #

Patch Set 2 : Hopefully fix iOS compile issue. #

Total comments: 20

Patch Set 3 : Updates for holte@, hopefully fix for iOS compile issue. #

Patch Set 4 : Updates for pnoland #

Patch Set 5 : Actually save global_id_mapper.h changes #

Total comments: 4

Patch Set 6 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+439 lines, -15 lines) Patch
M chrome/browser/sync/user_event_service_factory.cc View 1 chunk +5 lines, -3 lines 0 comments Download
M components/browser_sync/profile_sync_service.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/driver/fake_sync_service.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/fake_sync_service.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/driver/sync_service.h View 2 chunks +3 lines, -0 lines 0 comments Download
M components/sync/protocol/session_specifics.proto View 1 chunk +1 line, -1 line 0 comments Download
A components/sync/user_events/global_id_mapper.h View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
M components/sync/user_events/user_event_service_impl_unittest.cc View 3 chunks +8 lines, -1 line 0 comments Download
M components/sync/user_events/user_event_sync_bridge.h View 2 chunks +14 lines, -1 line 0 comments Download
M components/sync/user_events/user_event_sync_bridge.cc View 1 2 3 7 chunks +62 lines, -2 lines 0 comments Download
M components/sync/user_events/user_event_sync_bridge_unittest.cc View 1 2 3 3 chunks +60 lines, -1 line 0 comments Download
M components/sync_sessions/sessions_sync_manager.h View 6 chunks +18 lines, -1 line 0 comments Download
M components/sync_sessions/sessions_sync_manager.cc View 1 2 3 4 chunks +107 lines, -0 lines 1 comment Download
M components/sync_sessions/sessions_sync_manager_unittest.cc View 2 chunks +90 lines, -0 lines 0 comments Download
M ios/chrome/browser/sync/ios_user_event_service_factory.cc View 1 2 1 chunk +7 lines, -5 lines 0 comments Download
M tools/metrics/histograms/enums.xml View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (32 generated)
skym
PTAL
3 years, 5 months ago (2017-06-28 17:20:28 UTC) #5
skym
Forgot to assign reviewers to code: holte@ - histograms.xml pnoland@ - everything else
3 years, 5 months ago (2017-06-28 17:32:07 UTC) #8
Steven Holte
https://codereview.chromium.org/2958303002/diff/20001/components/sync_sessions/sessions_sync_manager.cc File components/sync_sessions/sessions_sync_manager.cc (right): https://codereview.chromium.org/2958303002/diff/20001/components/sync_sessions/sessions_sync_manager.cc#newcode1343 components/sync_sessions/sessions_sync_manager.cc:1343: UMA_HISTOGRAM_COUNTS("Sync.GlobalIdConflict", 1); UMA_HISTOGRAM_COUNTS is an alias for UMA_HISTOGRAM_COUNTS_1M (Using ...
3 years, 5 months ago (2017-06-28 18:59:45 UTC) #13
Patrick Noland
In the CL description, I think you meant to write "It is important that they ...
3 years, 5 months ago (2017-06-28 22:44:38 UTC) #15
skym
Updates for comments. https://codereview.chromium.org/2958303002/diff/20001/components/sync/user_events/global_id_mapper.h File components/sync/user_events/global_id_mapper.h (right): https://codereview.chromium.org/2958303002/diff/20001/components/sync/user_events/global_id_mapper.h#newcode17 components/sync/user_events/global_id_mapper.h:17: class GlobalIdMapper { On 2017/06/28 22:44:37, ...
3 years, 5 months ago (2017-07-05 19:14:29 UTC) #22
Patrick Noland
lgtm https://codereview.chromium.org/2958303002/diff/80001/components/sync/user_events/user_event_sync_bridge.cc File components/sync/user_events/user_event_sync_bridge.cc (right): https://codereview.chromium.org/2958303002/diff/80001/components/sync/user_events/user_event_sync_bridge.cc#newcode113 components/sync/user_events/user_event_sync_bridge.cc:113: const std::pair<int64_t, sync_pb::UserEventSpecifics> kv) { Can you use ...
3 years, 5 months ago (2017-07-05 23:59:32 UTC) #25
skym
https://codereview.chromium.org/2958303002/diff/80001/components/sync/user_events/user_event_sync_bridge.cc File components/sync/user_events/user_event_sync_bridge.cc (right): https://codereview.chromium.org/2958303002/diff/80001/components/sync/user_events/user_event_sync_bridge.cc#newcode113 components/sync/user_events/user_event_sync_bridge.cc:113: const std::pair<int64_t, sync_pb::UserEventSpecifics> kv) { On 2017/07/05 23:59:32, Patrick ...
3 years, 5 months ago (2017-07-06 17:28:55 UTC) #26
skym
Friendly ping holte@, I thought this was committed a while ago. Looks like I completely ...
3 years, 5 months ago (2017-07-21 22:53:52 UTC) #27
Steven Holte
histograms lgtm
3 years, 5 months ago (2017-07-21 23:13:42 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2958303002/100001
3 years, 5 months ago (2017-07-22 00:28:59 UTC) #37
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/a58a1f014663671847efd294313b99fe71e1a6bf
3 years, 5 months ago (2017-07-22 01:33:19 UTC) #41
vabr (Chromium)
3 years, 5 months ago (2017-07-22 08:22:22 UTC) #43
Message was sent while issue was closed.
This CL causes crash on iOS: https://crbug.com/747658

Please fix or revert at your earliest convenience.

Thanks!
Vaclav

https://codereview.chromium.org/2958303002/diff/100001/components/sync_sessio...
File components/sync_sessions/sessions_sync_manager.cc (right):

https://codereview.chromium.org/2958303002/diff/100001/components/sync_sessio...
components/sync_sessions/sessions_sync_manager.cc:596:
modified_tab->GetSerializedNavigationAtIndex(
This might be on the path of the crash in https://crbug.com/747658.

Powered by Google App Engine
This is Rietveld 408576698