Algorithms for Recovery and Isolation Exploiting Semantics: Difference between revisions

Content deleted Content added
Logging: correct meaning of Redo in Compensation Log Record.
m Undo: TT is transaction table. So, TT Table does not makes sense
Line 43:
After the Redo phase the database reflects the exact state at the crash. However the changes of uncommitted transactions have to be undone to restore the database to a consistent state.
 
For that we run backwards through the log for each transaction in the TT table (those runs can of course be combined into one) using the Previous Sequence Number fields in the records. For each record we undo the changes (using the information in the Undo field) and write a compensation log record to the log file. If we encounter a Begin Transaction record we write an End Log record for that transaction.
 
The compensation log records make it possible to recover during a crash that occurs during the recovery phase. That isn't as uncommon as one might think, as it is possible for the recovery phase to take quite long. CLRs are read during the Analysis phase and redone during the Redo phase.