New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 672596 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Fake Server updates progress markers nonsensically

Project Member Reported by s...@chromium.org, Dec 8 2016

Issue description

Right now there's significant logic in fake_server.cc to track the progress markers that are returned, primarily orchestrated through the UpdateSieve class https://cs.chromium.org/chromium/src/components/sync/test/fake_server/fake_server.cc?l=57

There is a significant oddity however. The progress marker for a data type is essentially the max of that data type's GU request progress marker and the largest version number that returned an entity in this GU request regardless of type.

This can cause odd problems when clients don't always ask for the same sets of data types. For example, imagine all progress markers are at 0, but there's a new bookmark in the fake server with version 1. Client A GUs with all types, and now will have all progress markers set to 1. However if Client B calls GU with just the bookmarks type, they will have just bookmark's progress marker set to version 1, everything else will remain at 0. And they can call subsequent GU calls with all types and this will not change, unless another item is committed to some data type.

This doesn't make any sense, and has caused a problem when switching to USS device info, TwoClientSearchEnginesSyncTest.DisableSync started to fail when DeviceInfoSyncBridge didn't commit itself during merge. Although clients typically perform GU calls with all types, this isn't true during initialization. This test case disables sync and re-enables it for client index 1. A GU for priority types goes out first, and it misses version 30 that was created for the added search engine entity. Instead priority prefs gets stuck on version 29 and AwaitQuiescence() is never satisfied.

Two options here, either all progress markers share a max version, or each data type operates independently. I think the latter is preferable, if clients try to ask for smaller sets of model types based on invalidation, it may cause tests to fail when they didn't update the progress markers for types that didn't even change.

The behavior is actually fairly disjoint from reality. Real progress markers are a function of the current time, and pretty much always change on GU. However, we do not want to copy that behavior, we want to be able to check for equality in our testing. Using the clock time would cause everything to fail.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ccc880c2592bb8d82d41dc3ca6559db2bb99280f

commit ccc880c2592bb8d82d41dc3ca6559db2bb99280f
Author: skym <skym@chromium.org>
Date: Fri Dec 09 23:28:43 2016

[Sync] Fake server now updates each model type's progress markers independently.

Previously the fake server used to update all of the progress markers
to the highest single version of an entity being returned in a
GetUpdates response. This caused odd behaviors when clients asked for
different sets of model types. This in turn resulted in tests failing
when they never agreed on some progress marker's version that wasn't
actually being actively updated.

This change separates all model types version/progress markers in the
fake server code. This should help clients that are being enabled
mid-test to get match progress markers when priority and non-priority
types are requested across separate GetUpdates messages.

Also removed some special case logic around filtering deleted items. It
is unclear what purpose that logic was serving.

BUG= 672596 

Review-Url: https://codereview.chromium.org/2564663003
Cr-Commit-Position: refs/heads/master@{#437690}

[modify] https://crrev.com/ccc880c2592bb8d82d41dc3ca6559db2bb99280f/components/sync/test/fake_server/fake_server.cc

Comment 2 by s...@chromium.org, Dec 12 2016

Blockedon: 673508

Comment 3 by s...@chromium.org, Dec 20 2016

Blockedon: -673508
Status: Fixed (was: Assigned)

Comment 4 by s...@chromium.org, Dec 20 2016

Blocking: -650725

Sign in to add a comment