Hello Eksolutions,
In general, the "UndoNextLSN" field applies to the CLR records only so
I won't show them for the first 8 entries (00 through 70). The PrevLSN
refers to the previous entry by the same task (e.g., T1 to T1).
LSN PrevLSN Log
00 none update: T1 writes P2
10 00 update: T1 writes P1
20 none update: T2 writes P5
30 none update: T3 writes P3
40 30 T3 commit
50 20 update: T2 writes P5
60 50 update: T2 writes P3
70 60 abort T2
----
At this point, there are three steps to be undone 60, 50, and 20 (in
the reverse order of application). Search backwards to find the last
step w/ T2 - LSN=60. The UndoNextLSN (UNLSN) for the first
Compensation Log Record comes from the PrevLSN of LSN 60. (repeat
until complete)
LSN PrevLSN UNLSN Log
80 70 50 clr: T2 undo P3
90 80 20 clr: T2 undo P5
100 90 none clr: T2 undo P5
110 100 end: T2
The primary reference for this answer is the same as the Database 4
answer
http://www.cs.colorado.edu/~rick/Classes/3287/Lectures/lec8_bw.pdf
Pages 15 and 16 have the most relevant material.
Note the slight difference in terminology. According to the reference,
there should also have been an end transaction after the T3 commit - I
can't be sure if the answer you are expecting to use needs the "110
... end" I provided.
--Maniac |