Algorithms for Recovery and Isolation Exploiting Semantics: Difference between revisions
Content deleted Content added
m →top: Added 1 doi to a journal cite |
Link suggestions feature: 2 links added. |
||
(12 intermediate revisions by 11 users not shown) | |||
Line 1:
{{Short description|Recovery algorithm}}
In [[computer science]], '''Algorithms for Recovery and Isolation Exploiting Semantics''', or '''ARIES''', is a recovery [[algorithm]] designed to work with a [[no-force]], steal database approach; it is used by [[IBM
Three main principles lie behind ARIES:
* [[Write-ahead logging]]: Any change to an object is first recorded in the [[database log|log]], and the log must be written to [[stable storage]] before changes to the object are written to disk.
*
*
== Logging ==
The ARIES algorithm relies on logging of all database operations with ascending Sequence Numbers. Usually the resulting logfile is stored on so-called "stable storage", that is a storage medium that is assumed to survive crashes and hardware failures.
The dirty page table keeps record of all the pages that have been modified, and not yet written
We create log records of the form (Sequence Number, Transaction ID, Page ID, Redo, Undo, Previous Sequence Number). The Redo and Undo fields keep information about the changes this log record saves and how to undo them. The Previous Sequence Number is a reference to the previous log record that was created for this transaction. In the case of an aborted transaction, it's possible to traverse the log file in reverse order using the Previous Sequence Numbers, undoing all actions taken within the specific transaction.
Every transaction implicitly begins with the first "Update" type of entry for the given
During a recovery, or while undoing the actions of an aborted transaction, a special kind of log record is written, the Compensation Log Record (CLR), to record that the action has already been undone. CLRs are of the form (Sequence Number, Transaction ID, Page ID, Redo, Previous Sequence Number, Next Undo Sequence Number). The Redo field contains application of Undo field of reverted action, and the Undo field is omitted because CLR is never reverted.
== Recovery ==
Line 29 ⟶ 30:
During the Analysis phase we restore the DPT and the TT as they were at the time of the crash.
We run through the logfile (from the beginning or the last checkpoint) and add all transactions for which we encounter Begin Transaction entries to the TT. Whenever an End Log entry is found, the corresponding transaction is removed. The last Sequence Number for each transaction is
During the same run we also fill the dirty page table by adding a new entry whenever we encounter a page that is modified and not yet in the DPT. This however only computes a superset of all dirty pages at the time of the crash, since we don't check the actual database file whether the page was written back to the storage.
Line 49 ⟶ 50:
== Checkpoints ==
To avoid
The naive way for [[Application checkpointing|checkpointing]] involves locking the whole database to avoid changes to the DPT and the TT during the creation of the checkpoint. Fuzzy logging circumvents that by writing two log records. One Fuzzy Log Starts Here record and, after preparing the checkpoint data, the actual checkpoint. Between the two records other log records can be created. During recovery it is necessary to find both records to obtain a valid checkpoint.
== References ==
|