Slideshow:
|
/* ==================================================
Step 1: identify the commited transactions
================================================== */
Scan the redo log:
{
identify the committed transaction
identify also the UNcommitted transaction (for writing abort records)
}
/* ==================================================
Step 2: redo the commited transactions
================================================== */
Scan the undo log forewards:
{
For ( each < T, A, v > in redo log )
{
if ( T is commited )
{
Update A with the (after) value v; // Redo the change !!!
}
}
}
/* =========================================================
Step 3: mark the uncommited tranasactions as failed....
========================================================= */
For ( each T that is uncommited ) do
{
Write <ABORT T> to log;
}
Flush-Log
|
|
Notice that:
|
|
Recovery:
|
Comment:
|
|
Recovery:
|
Comment:
|
|
2 possibilities:
|
Recovery if <COMMIT T> was written to disk:
|
Comment:
|
Recovery if <COMMIT T> was not written to disk:
|
Comment:
|
|
The <COMMIT T> record will not have been written !!!
Recovery:
|
Comment:
|