Closed Bug 1620186 Opened 4 years ago Closed 4 years ago

Fix race condition during synchronization

Categories

(Firefox :: Remote Settings Client, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 77
Tracking Status
firefox77 --- fixed

People

(Reporter: leplatrem, Assigned: leplatrem)

References

Details

Attachments

(2 files)

For the synchronization of a collection, we fetch data from 2 endpoints (metadata + records) with two different requests. This can lead to race conditions if data is modified in the interval.

Using a single endpoint instead of two, and thus having a single request instead of the current «two steps» synchronization, should prevent race conditions from happening.

On the server side, we could expose a new endpoint (eg. /buckets/{bid}/collections/{cid}/changeset) that would return both metadata and changes in one response.

{
  "data": {
    "changes": [{
        "id": "88687994-5344-11ea-8e6c-472e7b6636b2",
        "last_modified": ...
      },
      …
    ],
    "metadata": {
      …
    }
}

The changes would be filtered using ?_since=<> as usual.
The latest version will always be returned (latest metadata, latest changes since provided timestamp).

Assignee: nobody → mathieu

Depends on D71569

Attachment #9141717 - Attachment description: Bug 1620186 - Adjust tests to fetch from changeset endpoint → Bug 1620186 - Fetch from changeset endpoint
Pushed by mleplatre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0f24b88f0cbe
Upgrade kinto-client to 5.1.1 r=glasserc
https://hg.mozilla.org/integration/autoland/rev/20d2e7042fff
Fetch from changeset endpoint r=glasserc
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
Regressions: 1633502
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: