Recovery: Why Redo Loser-Transactions after System-crash? -
07-03-2004
, 07:47 AM
Hi ng,
i'm currently learning for a test and wondering why, in a case of a
systemcrash, I need to redo winner AND loser transactions.
scenario:
- using WAL Write Ahead log (write log before commit and before writing a
page to disc)
- TA A and TA B running
- TA A commited
- System crash
recovery:
- look at the log's and see TA A is winner and TA B is loser
- redo TA A and B (look if Log-sequence-number (LSN) is bigger than the
page-LSN of the table on disc; if yes => redo the saved operation)
- undo loser transaction (TA B)
could you give me an example where this is necessary?
The script say's its necessary to have idempotent log-files... so a 2nd
crash during recovery and 2nd recovery won't cause problems...
But if a 2nd crash occurs TA B will still be a loser!? Hmmm seems it don't
see the reason for this?!
thanks,
Stefan |