Information Technology Reference
In-Depth Information
Fig. 8.10 Transaction T 1 is
performing the action
WŒx; u ; v . Another
transaction T 2 wants to
perform the action IŒy; v 0 ,
where y is covered by
page p 4
A further complication arises when in the backward scan of the log in the undo
pass we encounter the log record of an update action that has to be undone logically
on the B-tree that, as the result of the redo pass, is still in an inconsistent state
because of a yet-undone incomplete structure modification.
Example 8.17 A transaction T 1 wants to perform the action WŒx; u ; v .Forthat
purpose, the process thread executing T 1 latch-couples the path p 1 ! p 2 ! p 3 !
p 4 from the root p 1 of a B-tree down to the leaf page p 4 that covers key x (see
Fig. 8.10 ). Once it has reached page p 4 , the thread executing T 1 has this page write-
latched.
Another transaction T 2 now wants to perform the action IŒy; v 0 , where page p 4
covers key y ¤ x. For this action, the thread executing T 2 latch-couples the path
p 1 ! p 2 ! p 3 and is put to sleep waiting for a write latch on page p 4 .Pagep 4 is
still write-latched by the thread executing T 2 .
A third transaction T 3 is performing an insertion into page q 4 , which is full,
causing splits along the path p 1 ;p 2 ;q 3 ;q 4 allthewayuptopagep 2 . Assume that the
sequence of splits is almost complete so that only the insertion of the index record
.x 0 2 ;p 0 2 / into page p 1 is still missing (see Fig. 8.11 ). The following log records have
been written:
n 1 Wh T 1 ;B i ,
n 2 Wh T 2 ;B i ,
n 3 Wh T 3 ;B i ,
n 4 Wh S; begin-smo i ,
n 5 Wh S; page-split ;q 4 ;x 0 4 ;q 0 4 ;s 4 ;V 4 ;1;n 4 i ,
n 6 Wh S; page-split ;q 3 ;x 0 3 ;q 0 3 ;s 3 ;V 3 ;2;n 5 i ,
n 7 Wh S; insert-index-record ;q 0 3 ;x 0 4 ;q 0 4 ;n 6 i ,
n 8 Wh S; page-split ;p 2 ;x 0 2 ;p 0 2 ;s 2 ;V 2 ;3;n 7 i .
Search WWH ::




Custom Search