Slideshow:
|
|
Undo/redo log record: < T, X, v, w > T = transaction ID X = DB element v = before value w = after value |
In other words:
|
|
Transaction manager executes an operation /* ================================================================== Undo/redo log write rule: First write <T, X, v, w > to disk then write X to disk ================================================================== */ if ( operation = OUTPUT(X) ) { FLUSH log; // Write all log records to disk // including the <T,X,v,w> log record // We made sure that OUTPUT(X) can be undone OUTPUT(X); else { perform operation; } |
Notice the undo-redo log write rule in action:
|
Notice the benefit of undo-redo logging:
|