212k views
3 votes
E xercise 17.2.4: The following is a sequence of undo-log records written by two transactions T and U: < START T>; ; < START U>; ; ; ; ; < T ,E , 50>; . Describe the action of the recovery manager, including changes to both disk and the log, if there is a crash and the last log record to appear on disk is: (a) < START U> (b) (c) < T ,E , 50> (d) .

User Deepzz
by
5.4k points

1 Answer

5 votes

Answer:

Check the explanation

Step-by-step explanation:

The following is a sequence of Undo — log records written by two transactions.

<START 1>; <F, A, 10>; <START U>; <U, B, 20>; <F, C, 30>; <U, D, 40>; <COMMIT U>; <T, E, 50>; <COMMIT T>; (a) < START U >;

If the system crashes after the log < START U >,

Then we have log records will be shown below.

<START U>;

<T, A, 10>;

<START T>;

SYSTEM CRASHED

The recovery manager sees the Undo - Redo log and inspect the both trans-actions T and U are not committed. Then those elements changed by both transactions are arranged to their old values.

  1. Transaction T changes the element A.
  2. Then the Element A is arranged to old value A=10.
  3. Transaction U did not change any existing element in the records.
  4. So, not anything to do with transaction U.

(B) < T, E, 50>;

If the system crashes after the log < T, E, 50>;

Then we have log records will be shown below .

START T>;

<T, A, 10>;

<START U>;

<U, B, 20>;

<T, C, 30>;

<U, D, 40>;

<COMMIT U>;

<T, E, 50>;

SYSTEM CRASHED

The recovery manager sees the Redo logs and inspect the transaction U is committed or not. Such changes made by transaction U are reached to disk.

• So much the recovery manager arranged the elements to their recent values changed by transaction U.

• Transaction U changed the elements B and its records <U, B, 20>with re-cent values.

• Transaction U changed the elements D and its records <U, D, 40>with recent values.

• The transaction T is not committed.

• Then the elements changed by transaction T are arranged to old values.

• Then element A is arranged to 10, C is arranged to 30 and E is arranged to 50.

User Ssindelar
by
5.0k points