A server manages the objects a1, a2,... an. The server provides two operations for its clients:

Read (i) returns the value of

Write(i, Value) assigns Value to

The transactions T, U and V are defined as follows:

T: x= Read (i); Write(j, 44);

U: Write(i, 55);Write(j, 66);

V: Write(k, 77);Write(k, 88);

Describe the information written to the log file on behalf of these three transactions if strict two-phase locking is in use and U acquires ai and aj before T. Describe how the recovery manager would use this information to recover the effects of T, U and V when the server is replaced after a crash. What is the significance of the order

of the commit entries in the log file?

As transaction U acquires aj first, it commits first and the entries of transaction T follow those of U. For simplicity we show the entries of transaction V after those of transaction T.



On recovery, the recovery manager sets default values in the data items a1...an. It then starts at the end of the log file (at position P10). It sees V has committed, finds P9 and V's intentions list and restores ak=88. It then goes back to P7 (T commit), back to P6 for T's intentions list and restores aj=44. It then goes back to P4 (U commit), back to P3 for U's intentions list . It ignores the entry for aj because it has already been recovered, but it gets ai=55. The values of the other data items are found earlier in the log file or in a checkpoint.



The order of the commit entries in the log file reflect the order in which transactions committed. More recent transactions come after earlier ones. Recovery starts from the end, taking the effects of the most recent transactions first.

Computer Science & Information Technology

You might also like to view...

The ISP allows more than one person to edit a document in a document library

Indicate whether the statement is true or false

Computer Science & Information Technology

________ shows the report and the data; some report design such as field lengths and fonts can be changed in this view

A) Report view B) Print Preview C) Layout view D) Design view

Computer Science & Information Technology