Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the following execution shown below, explain what is done in each of the A

ID: 3869248 • Letter: U

Question

Using the following execution shown below, explain what is done in each of the ARIES recovery algorithm phases:

LSN

LOG

00

begin_checkpoint

10

end_checkpoint

20

update: T1 writes P1

30

update: T2 writes P2

40

update: T3 writes P3

50

T2 commit

60

update: T3 writes P2

70

T2 end

80

update: T1 writes P5

90

T3 abort

CRASH, RESTART

LSN

LOG

00

begin_checkpoint

10

end_checkpoint

20

update: T1 writes P1

30

update: T2 writes P2

40

update: T3 writes P3

50

T2 commit

60

update: T3 writes P2

70

T2 end

80

update: T1 writes P5

90

T3 abort

CRASH, RESTART

Explanation / Answer

00 begin_checkpoint : Indicates when check point began

10 end_checkpoint : Contains current Xact table and dirty page table.


20 update: T1 writes P1: Add (T1,20) to TT and (P1,20) to DPT

30 update: T2 writes P2: Add (T2,30) to TT and (P2,30) to DPT.


40 update: T3 writes P3: Add (T3,40) to TT and (P3,40) to DPT

50 T2 commit: Change status of T2 to C


60 update: T3 writes P2: Change (T3,40) to (T3,60)


70 T2 end: Remove T2 from TT

80 update: T1 writes P5: Change (T1,20) to (T1,70) and add (P5,70) to DPT

90 T3 abort: No action
CRASH, RESTART


Undo Phase:

At the end of analysis,

the transaction table contains the following entries:

(T1,80), and (T3,60).

The Dirty Page Table has the following entries:

(P1,20), (P2,30), (P3,40), and (P5,80).

Starts from the end to the begin of the oldest non-committed transaction.
80 Undo the changes in P5 by T1.

60 Undo the changes on P2 by T3.

40 Undo the changes on P3 by T3.

20 Undo the changes on P1 by T1.

Redo Phase

20 No action on P1. T1 is a lost transaction.

30 Redo the change in P2 by T2.

40 No action on P3. T3 is a lost transaction.

60 No action on P2. T3 is a lost transaction.
80 No action on P5. T1 is a lost transaction.