Pref service: provide eventual consistency with multiple writers.
Currently, if two writers both write to a single pref or a single subpref without seeing each other's writes, the two writers will each converge to the other's value rather than a shared value. This CL corrects this by eventually converging all clients to the last value observed by the service, without any values moving backwards in serialized write order. To provide eventual consistency, each client tracks the prefs for which a write has been sent to the pref service, but which have not been acknowledged. The acks are sent on the same interface as updates triggered by other clients so any remote writes received before an ack are writes that have been serialized to after the in-flight write. Thus, the client can ignore such writes. Since prefs are hierarchical and writes can be applied to individual sub-components of a single pref, writes to parent and child values can race. If the parent write is applied first, then the client writing the child value does not have a simple strategy to resolve the conflicting changes with the information it has. Instead, in these cases, it requests a value from the service for the parent value. Such values are returned as pref value updates, just like notifications of a write by another client and conflicts are handled similarly. Bug: 654988 Change-Id: I1959f1b100134d9dc3af2b1c94d6ec08b139b8ce Reviewed-on: https://chromium-review.googlesource.com/522303Reviewed-by:Johan Tibell <tibell@chromium.org> Reviewed-by:
Robert Sesek <rsesek@chromium.org> Commit-Queue: Sam McNally <sammc@chromium.org> Cr-Commit-Position: refs/heads/master@{#477850}
Showing
This diff is collapsed.
Please register or sign in to comment