Crash Recovery
Crash Recovery
steal approach
When a transaction commits must we ensure
that all the changes it has made to objects in
the buffer are immediately forced to disk?
If this approach is used it is termed as force
approach.
From the view point of recovery manager it is
simplest to use a buffer manager with a no-
steal, force approach.
But due to the disadvantages of no-steal
force approach most systems use a steal, no
force approach.
Recovery related steps during normal
execution
Recovery manager maintains a log of all
modifications to the database on stable
storage.
Stable storage is implemented by maintaining
multiple copies of information on non-volatile
storage devices.
Log entries describing a change to the
database are written to stable storage before
the change is made.
If the transactions are running serially then
there are 2 ways for recovery. They are;
Log based recovery
Shadow paging
Log based recovery
Also known as trail or journal.
Consists of log records.
Log record has;
Transaction identifier
Data item identifier
Old value
New value
When transaction T starts, it registers itself by writing
a
<T start>log record
Before T executes write(X), a log record
<T, X, V1, V2> is written.
When T finishes it last statement, the log record <T
commit> is written
Types of log based recovery
Deferred database modification
Immediate database modification
Checkpoints
Deferred database modification