Slideshow:
|
|
|
|
1. Make the DBMS stop accepting new transactions 2. Wait until all currently active transactions to commit or abort (and have written a <COMMIT> or <ABORT> log record) 3. Write all buffers updated by the transactions to disk 4. Write <CKPT> (checkpoint) to log ---- Marks the "useful" boundary 5. Flush the log to disk 6. Resume accepting new transactions |
|
|
/* ================================================== Step 1: identify the uncommited transactions ================================================== */ Scan the undo log backwards until first <CKPT> record: { identify the committed identify the uncommitted/aborted transactions } /* ================================================== Step 2: undo the uncommited transactions ================================================== */ Scan the undo log backwards until first <CKPT> record: { For ( each < T, A, v > in log file ) { if ( T is uncommited ) { Update A with the (before) value v; // Undo the action !!! } } } /* ========================================================= Step 3: mark the uncommited tranasactions as failed.... ========================================================= */ For ( each T that is uncommited ) do { Write <ABORT T> to log; } Flush-Log |