Information Technology Reference
In-Depth Information
Now the maximum of the U NDO -N EXT -LSN s in the active-transaction table is 111.
Thus, the next log record to be processed is the one with LSN 111. This is the begin-
transaction log record for T 3 . So the rollback of T 3 has been completed, the commit
log record
121: h T 3 ;C i
is appended to the log buffer, the log is flushed, and the transaction record of T 3
is deleted from the active-transaction table. The contents of the active-transaction
table are now
f .T 2 ; backward-rolling; U NDO -N EXT -LSN D 110/ g .
The next log record to be processed is the one with LSN 110, written for the
action DŒx 1 ; v 0 1 performed by T 2 on page p 1 .Pagep 1 is fixed and write-latched.
We observe that page p 1 still covers key x 1 and that there is room for the tuple
.x 1 ; v 0 1 / in the page. The undo action D 1 Œx 1 ; v 0 1 is performed by inserting the tuple
.x 1 ; v 0 1 / into page p 1 , the redo-only log record
122: h T 2 ;D 1 ;p 1 ;x 1 ; v 0 1 ; 108 i
is appended to the log buffer, P AGE -LSN .p 1 / 122 is set, page p 1 is unlatched
and unfixed, and U NDO -N EXT -LSN .T 2 / 108 is set in the active-transaction
table.
The contents of the active-transaction table are now
f .T 2 ; backward-rolling; U NDO -N EXT -LSN D 108/ g .
The next log record to be processed is thus the one with LSN 108, the begin-
transaction log record for T 2 . As the rollback of T 2 is thus complete, the log record
123: h T 2 ;C i
is appended, the log is flushed, and the transaction record of T 2 is deleted from the
active-transaction table.
This completes the undo pass, because the active-transaction table is now empty.
The logical database has been brought to a state that contains only the updates by
the committed transactions T 1 and T 4 .
t
Theorem 4.8 The analysis pass followed by the redo pass followed by the undo
pass brings the database to a transaction-consistent state that contains all the
updates by transactions that committed before the crash and none of the updates
by other transactions, provided that the sequence of undo actions to be performed
in the undo pass can be run on the logical database resulting from the redo
pass.
Proof By Theorem 4.6 , the redo pass brings the database into an action-consistent
state that is the result of applying the sequence of update actions whose log records
are found on the disk at the time of the crash. As every transaction that committed
Search WWH ::




Custom Search