1.3 Recovery

This section covers basic recovery concepts and techniques, and the ARIES recovery framework in particular.

General principles

Recovery to a consistent state is required after any kind of system failure. To enable such recovery, redundant storage of some kind is required. A (sequential) write-ahead log in which (update) operations are recorded before being performed on the database is the most commonly used technique. (The main alternative is the use of ``shadow pages''.)

The log must be written to stable storage. Each log entry typically describes the operation performed, the initial value of any updated item and the final value of any updated item.

It is also necessary to keep track of current and completed transactions.

On restart after a failure, the basic recovery process is to use the log stored on stable storage to undo the effects of aborted and incomplete transactions (in reverse order) and to redo the effects of committed transactions (in forward order).

A complication is that both the database itself and the log use memory buffers, so data written to the database or to the log are not necessarily recorded in stable storage immediately. Related to this is the fact that both the database and the log are written to disk a page at a time, not an item at a time. A transaction is regarded as committed when the ``commit'' entry written to the log is recorded on stable storage.

Key choices for the recovery manager implementor include:

Recovery managers may decide whether or not to use force and/or steal independently.

Checkpoints are used to periodically write the log and changed database pages to disk, recording the fact on the disk, to reduce the work required on restart after failure.

It's important that restart be idempotent: if a failure occurs during restart, and a second restart is performed, the effect should be the same as if the first restart had completed.

ARIES

ARIES is a widely used framework for recovery management with many possible generalisations (in particular to nested transactions).

ARIES has the following general characteristics:

Although ARIES is a flexible, efficient and widely used framework for recovery management, the details are complex, and readers are referred to the following selected references for details.

References