Information Technology Reference
In-Depth Information
Fig. 4.3 Log contents on the
log disk at the time of a
system crash
101:
T 1 ,B
102:
T 1 ,D,p 1 ,x 1 ,v 1 ,
101
103: begin-checkpoint
104: active-transaction-table,
{
(
T 1 ,
forward-rolling
, Undo-Next-LSN =102)
105: modified-page-table
, {
(
p 1 , Rec-LSN =102)
106: end-checkpoint
107:
T 1 ,I,p 1 ,x 1 ,v 1 , 102
108:
T 2 ,B
109:
T 1 ,C
110:
T 2 ,D,p 1 ,x 1 ,v 1 , 108
111:
T 3 ,B
112:
T 3 ,I,p 2 ,x 2 ,v 2 ,
111
113:
T 2 ,I,p 1 ,x 3 ,v 3 ,
110
114:
T 2 ,A
T 2 ,I 1 ,p 1 ,x 3 , 110
115:
116:
T 4 ,B
117:
T 4 ,I,p 2 ,x 4 ,v 4 ,
116
118:
T 4 ,C
In the analysis pass, no pages of the database are read or written: only the
log is read, and main-memory structures, namely, the active-transaction table and
modified-page table, are reconstructed.
Example 4.3 Assume that at the time of a system crash, the log contents surviving
on the log disk are as shown in Fig. 4.3 . The log contents are the result of running
the sequence of actions
B 1 D 1 Œx 1 ; v 1 B C :::E C I 1 Œx 1 ; v 0 1 B 2 C 1 D 2 Œx 1 ; v 0 1 B 3 I 3 Œx 2 ; v 2 I 2 Œx 3 ; v 3
A 2 I 2 Œx 3 ; v 3 B 4 I 4 Œx 4 ; v 4 C 4 ,
where the numerical subscript in an action indicates the transaction (T 1 , T 2 , T 3 or T 4 )
that performed the action and B C :::E C are the actions performed by the system in
taking the fuzzy checkpoint. After performing the commit action C 4 of transaction
T 4 (which includes flushing the log), some further actions by other transactions may
have been performed before the crash, but as their log records have not been taken
onto disk from the log buffer, no trace of them remains.
In the analysis pass, the log is scanned forward from the begin-checkpoint log
record at LSN 103 to the end of the log. During the log scan, the following actions
are performed at LSN s 103-118:
103: No action.
104: The active-transaction table is initialized from the logged copy as
f .T 1 ; forward-rolling; U NDO -N EXT -LSN D 102/ g .
105: The modified-page table is initialized from the logged copy as
f .p 1 ; R EC -LSN D 102/ g .
106: No action.
Search WWH ::




Custom Search