|
That means:
|
|
|
|
1. Write a start checkpoint log record:
<START CKPT(T1, T2, ..., Tk)>
where T1, T2, ..., Tk are the currently active transactions
Flush-Log (This will ALSO write ALL <T, x, v, w> records to disk !!!)
3. Write:
All DB elements that were updated by committed transactions
to disk
4. Write <END CKPT> to log
Flush-Log
|
|
|
|
/* ==================================================
Step 1: identify the commited transactions
================================================== */
Scan the redo log backwards until first <START CKPT(T1, T2, ..., Tk) record:
{
identify the committed
identify the uncommitted/aborted transactions
}
/* ==================================================
Step 2: redo the commited transactions
================================================== */
Scan the redo log backwards
until we found all <START T1>, <START T2>, ..., <START Tk> records
Starting from this point, scan the redo log forewards
{
For ( each < T, A, v > where T is commited ) do
{
Update A with the (after) value v; // Redo the action !!!
}
}
/* =========================================================
Step 3: mark the uncommited tranasactions as failed....
========================================================= */
For ( each T that is uncommited ) do
{
Write <ABORT T> to log;
}
Flush-Log
|
|
|
|
|
|
|
/* ==================================================
Step 1: identify the commited transactions
================================================== */
Scan the redo log backwards until first <START CKPT(T1, T2, ..., Tk) record:
{
identify the committed
identify the uncommitted/aborted transactions
}
/* ==================================================
Step 2: redo the commited transactions
================================================== */
Scan the redo log backwards
until we found all <START T1>, <START T2>, ..., <START Tk> records
Starting from this point, scan the redo log forewards
{
For ( each < T, A, v > where T is commited ) do
{
Update A with the (after) value v; // Redo the action !!!
}
}
/* =========================================================
Step 3: mark the uncommited tranasactions as failed....
========================================================= */
For ( each T that is uncommited ) do
{
Write <ABORT T> to log;
}
Flush-Log
|
|