Example: Normal Transaction Execution

Setup
This example will describe the actions that the Write Ahead Log takes in the normal execution of a transaction. We will be using only components described in the WAL Logging Framework.

Assumptions

 * strict two phase locking concurrency control
 * STEAL, NO-FORCE buffer management with WAL
 * Disk writes are atomic
 * Transactions are a series of reads and writes, followed by a commit or abort

Components
The components we are using are described by something I call the logging framework and is shown to the right.

Process
For every update operation: When the buffer manager replaces a dirty page:
 * Create a log record with a LSN larger than the max LSN in existence. Note that these log records are not necessarily flushed out to the log disk until a commit is required.
 * Update the transaction table with the lastLSN being the current update record
 * Update the dirty pages table to include the page we updated if that page is not already in the dirty pages table
 * Remove its entry from the dirty pages table