Available copies replication is applied to data items A and B with replicas Ax, Ay and Bm, Bn. The transactions T and U are defined

T: Read(A); Write(B, 44). U: Read(B); Write(A, 55).

Show an interleaving of T and U, assuming that two-phase locks are applied to the replicas. Explain why locks alone cannot ensure one copy serializability if one of the replicas fails during the progress of T and U. Explain with reference to this example, how local validation ensures one copy serializability.

An interleaving of T and U at the replicas assuming that two-phase locks are applied to the replicas: T U
x:= Read (Ax) lock Ax

Write(Bm, 44) lock Bm

x:= Read (Bm) Wait

Write(Bn, 44) lock Bn • Commit unlock Ax,Bm,Bn •
Write(Ax, 55) lock Ax

Write(Ay, 55) lock Ay

Suppose Bm fails before T locks it, then U will not be delayed. (It will get a lost update). The problem arises because Read can use one of the copies before it fails and then Write can use the other copy. Local validation ensures one copy serializability by checking before it commits that any copy that failed has not yet been recovered. In the case of T, which observed the failure of Bm, Bm should not yet have been recovered, but it has, so T is aborted.

Computer Science & Information Technology

You might also like to view...

In a database of employees, Last Name would be a good field to use as the primary key

Indicate whether the statement is true or false

Computer Science & Information Technology

To add a second condition to a VBA procedure you would use a(n) ________

A) True, False B) This for That statement C) If This, Then That statement D) If Then, Else statement

Computer Science & Information Technology