Thursday, May 4, 2023

 

When a server executes a write for the last time, that write is said to be stable.  Writes are repeated because other servers may ask for it to be undone. A given write may be repeated many times and the results will depend on the execution history of the server. A write becomes stable when the set of writes that precede it in the server’s write log become stable. This means that the server has already received and executed any writes that could possibly be ordered before the given write.

The corresponding concept for the application is termed commitment. As in the example of meeting room scheduling application, users may try to schedule separate meetings for the same time in the same room. Only when one of the users discovers that the writes has become stable and his schedule still shows that he has reserved the room for the desired time, can he be sure that the tentative reservation has been scheduled.

Since clients require to know that a write has stabilized, the Bayou API provides means for enquiring about the stability of a specific write. The answer may depend on the server that is asked but Bayou also provides support for clients that may choose to access only stable data.  

There are many approaches to determining when a write is stable. One approach requires the servers to exchange information about the set of writes along with the current value of the clock that it uses to timestamp new writes. With suitable assumptions about the propagation order of writes, a server could then determine that a write is stable when it has a lower timestamp than all the servers’ clocks. The main drawback with this approach is that a server that remains disconnected can prevent writes from stabilizing, which could cause a large number of writes to rollback, when the server reconnects.

Since Bayou does not require network connectivity to stay up all the time, one way to speed up the rate at which the writes stabilize involves a commit procedure.  A write becomes stable when it is clearly called out as committed. Committed writes in commit order are placed ahead of any tentative writes in each servers’ write log. This along with the information exchange between servers provides stability.

When a server designated as the primary takes responsibility for committing updates, it is called a primary commit. Knowledge of which writes have committed, and in which order they were committed then propagates to the other server. The primary behaves like any other server in all other aspects. Different replicated data collections can have a different server designated as primary.  Any commit protocol that prevents different groups of servers from committing updates in different orders would meet Bayou needs.

 

No comments:

Post a Comment