Information Technology Reference
In-Depth Information
where q 0 is the page-id of the index leaf page in which the record resided. Otherwise,
if the index is not yet available so that the side file is still open for transactions to
append records, the append-to-side-file action is undone by appending the record
. ix-I 1 ;y;x;p/to the side file and logging the append with the redo-only log record
n 3 : h T; append-to-side-file ;q 00 ; ix-I 1 ;y;x;p;n 1 i ,
where q 00 is the page-id of the side-file page that received the record. Observe that
all updates (appends) to the side file are redo-only actions, no matter whether they
result from forward-rolling or backward-rolling actions by transactions.
In case (2), if the index has become available, the index constructor has captured
the inserted tuple .x; y; v / in its then current data page p 0 and inserted the record
.y;x;p 0 / to the index; therefore, the no-append-to-side-file action is undone by
traversing the index in search for record .y;x;p 0 /, deleting it and logging the
deletion with the redo-only log record
n 3 : h T; q 0 ; ix-I 1 ;y;x;p 0 ;n 1 i ,
where q 0 is the page-id of the index leaf page in which the record resided.
Otherwise, in case (2), when the index is not yet available, we have to check if the
extraction process has now advanced past x. To ensure consistency of this check, we
must write-latch the primary-index leaf page that currently holds the tuple .x; y; v /.
Of course, we guess that the page is still p and therefore write-latch it and check
if the page still holds the record and also that the page will not underflow by the
deletion; if not, we must use the call find-page-for-undo-insert .p; x/ (see Sect. 7.6 )
to traverse the primary index so as to locate and write-latch the page p 0 that currently
holds the tuple (recall that this call also performs any structure modifications needed
to accommodate the undo action).
Then we compare x and Cursor .Ifx> Cursor , the extraction process still has
not advanced past x, so no undoing of an index-record insertion needs to be done,
and we just set U NDO -N EXT -LSN back to n 1 and proceed to undo the insertion of the
tuple. Otherwise, when x< Cursor , the extraction process has advanced past x,
capturing the inserted tuple .x; y; v / in its then current page p 0 and inserting the
record .y;x;p 0 / to the index. Therefore, as the side file is still open for transactions
to append records, the no-append-to-side-file action is undone by appending the
record . ix-I 1 ;y;x;p/ to the side file and logging the append with the redo-only
log record
n 3 : h T; append-to-side-file ;q 00 ; ix-I 1 ;y;x;p;n 1 i ,
where q 00 is the page-id of the side-file page that receives the record.
In case (3), the index-record insertion is undone in the obvious way from the
index and logged with the redo-only log record
n 3 : h T; q 00 ; ix-I 1 ;y;x;p;n 1 i ,
where q 00 is the page-id of the index leaf page in which the record currently resided.
Search WWH ::




Custom Search