Slideshow:
Database Log file ================================================= <START T> ... Write(X1) <T, X1, v1> ... Write(X2) <T, X2, v2> ... COMMIT <COMMIT T> ++++++++ FLUSH log Later on, the DBMS make updates at its convenience: ... <OUTPUT X1> ... <OUTPUT X2> |
|
This property is the result of the redo log update rule:
Transaction manager executes an operation /* ================================================================== Redo log write rule: Only update database elem's modified by committed transactions. ================================================================== */ if ( operation = OUTPUT(X) ) { /* ============================================= Database elem X was updated by transaction T ============================================= */ if ( T's state == COMMITTED ) { FLUSH log; // Write all log records to disk // including the log records belonging to T // We made sure that all updates by T can be (re)done OUTPUT(X); // (When) we make one of the updates of T to disk } else { return; // Do not write data updated by // an uncomitted transaction to disk !!! } } else { perform operation; } |
|
Database Log file
=================================================
<START T>
...
Write(X1) <T, X1, v1>
...
Write(X2) <T, X2, v2>
...
COMMIT <COMMIT T> ++++++++
FLUSH log
Later on, the DBMS make updates at its convenience:
...
<OUTPUT X1>
...
<OUTPUT X2>
|
|
|
|
Example:
|
|
|