Wednesday, May 10, 2023

 

Application specific conflict detection is accomplished in the Bayou system with dependency checks. An application can specify it in the form of a query and an expected result that the server can run against its current data. A conflict is detected if the actual results do not match the application specified expected result. If the pre-condition fails, the requested update is not performed.  The server invokes a procedure to resolve the detected conflict.

Once a conflict is detected, a merge procedure is run by the Bayou server in an attempt to resolve the conflict. Merge procedures included with each write operation are routines written in a high-level language. These procedures can have embedded data or application specific logic related to the update that was being attempted. The merge procedure associated with the write is responsible for resolving any conflicts detected by its dependency check and for producing a revised update to apply. The complete process of detecting a conflict, running a merge procedure, and applying the revised update is performed atomically as part of executing a write.

The meeting room scheduling application provides a good reference for the dependency check and the merge procedure. In this application, users understand their reservations may be invalidated by other concurrent users and can specify alternate scheduling choices as part of their original scheduling updates. Since these are encoded into the merge procedure, it attempts to reserve one of the alternate meeting times if the original time is found to have a conflict with the original time.

In case automatic conflict resolution is not possible, it will still run to completion but will spew a log entry for the detected conflict in some fashion that enables manual intervention to resolve it later.

The replicas held by two servers at any time may vary in their contents because they have received and processed different writes, a fundamental property of the Bayou design is that all servers move towards eventual consistency. The Bayou system guarantees that all the servers eventually receive all writes via the pair-wise exchanges and that two servers holding the same set of writes will have the same data contents. But it cannot enforce strict bounds on write propagation delays since these depend on network connectivity factors that are outside of the Bayou’s control. Two important features of the Bayou system design allow the servers to achieve eventual consistency. First, writes are performed in the same well-defined order at all servers. Second, the conflict detection and merge procedures are deterministic so that the servers resolve the same conflicts in the same manner.

No comments:

Post a Comment