Information Technology Reference
In-Depth Information
3.3
Active-Transaction Table and Modified-Page Table
For the purposes of managing transactions during normal processing, the database
management system records volatile information about currently active transactions.
For each active-transaction T , the following information is kept in the active-
transaction table ,or transaction table for short:
1. The transaction identifier of T
2. The (type of the) transaction state of T : “forward-rolling” or “backward-rolling”
3. The U NDO -N EXT -LSN of T ,thatis,the LSN of the log record of the latest not-yet-
undone forward-rolling update action by T
4. Other information relevant for an active transaction, such as a pointer to a chain
of locks held by the transaction (see Sect. 6.1 )
The entry for transaction T is called the transaction record of T . The table
is implemented using an efficient main-memory structure (hashing based on the
transaction-id).
In practice, the transaction record for T also contains P REV -LSN ,the LSN of the
latest logged action of T , but we omit it because it is not needed in the algorithms
presented in this topic. When T contains no undo actions, the sequence of log
records for update actions in the U NDO -N EXT -LSN chain of T is equal to that in the
P REV -LSN chain of T . In the general case the log records in the U NDO -N EXT -LSN
chain form a subsequence of those in the P REV -LSN chain: rolled-back sequences
are not included in the U NDO -N EXT -LSN chain, and some transaction-control actions
are neither. For example, in Fig. 3.1 athe U NDO -N EXT -LSN and P REV -LSN chains are
equal, but in Fig. 3.1 cthe P REV -LSN chain links the log records for C , D 1 Πz ; w ,
I 1 Πz ; w 0 , A, IΠz ; w 0 , DΠz ; w ,andB.
The active-transaction table is created and initialized to be empty when the
system starts up. When a new transaction arrives in the system, a new transaction
identifier T is reserved for it, the begin-transaction log record h T; B i is written to
the log, and the entry
.T; forward-rolling; U NDO -N EXT -LSN D n/
is inserted into the active-transaction table, where n is the LSN of T 's begin-
transaction log record, marking the end of the U NDO -N EXT -LSN chain. When a
transaction commits or completes its rollback, its entry is deleted from the active-
transaction table.
For the purposes of transaction rollback and restart recovery, it would only be
necessary to record in the active-transaction table information about active transac-
tions that have performed at least one update action, while it seems unnecessary
to record their information about read-only transactions that only perform read
actions. However, for the purposes of concurrency control, a transaction needs to
have a unique transaction identifier when it acquires its first lock on a data item it
wants to read or update.
Search WWH ::




Custom Search