Information Technology Reference
In-Depth Information
The write action WŒx;
u
;
v
performed by transaction T on data page p is logged
with the
write
log record
n
Wh
T; W; p; x;
u
;
v
;n
0
i
:
(3.8)
The insert action IŒx;
v
performed by transaction T on data page p is logged
with the
insert
log record
n
Wh
T; I; p; x;
v
;n
0
i
:
(3.9)
The delete action DŒx;
v
performed by transaction T on data page p is logged
with the
delete
log record
n
Wh
T; D; p; x;
v
;n
0
i
:
(3.10)
The log records for the above three forward-rolling update actions are
redo-undo
log records
: using them, the action can be both redone (physically) and undone
(physically or, if this is not possible, logically).
The log record for a backward-rolling update action by transaction T contains
the name and (part of the) arguments of the action, as well as the
U
NDO
-N
EXT
-LSN
value n
0
.
The undo action W
1
Œx;
u
;
v
performed by transaction T on page p is logged
with the
undo-write
log record
n
Wh
T; W
1
;p;x;
u
;n
0
i
;
(3.11)
when the log record for the respective forward-rolling write action WŒx;
u
;
v
by T
is n
00
Wh
T; W; p
0
;x;
u
;
v
;n
0
i
for some n
00
<nand p
0
. Note that it is not necessary
to record the new value
v
for redoing the action that reverts to the old value
u
.Also
note that the page p onto which the undo action is performed may be different from
the page p
0
onto which the forward-rolling action was performed, because the tuple
.x;
v
/ may have migrated from page p
0
to page p in the interim due to structure
modifications caused by T or other transactions.
The undo action I
1
Œx;
v
performed by transaction T on page p is logged with
the
undo-insert
log record
n
Wh
T; I
1
;p;x;n
0
i
;
(3.12)
when the log record for the respective forward-rolling insert action IŒx;
v
by T is
n
00
Wh
T; I; p
0
;x;
v
;n
0
i
for some n
00
<nand p
0
. Note that it is not necessary to
record the entire inserted tuple in the log: this log record is only used to redo the
undo of an insertion, which is a deletion of the tuple with key value x.Ifp
6D
p
0
,
the tuple .x;
v
/ has migrated from page p
0
to page p in the interim.