Recovery with WAL-Logs - why 'redo' the loser-transactions?

From: Stefan Oedenkoven <stefan-oedenkoven_at_gmx.de>
Date: Thu, 1 Jul 2004 20:21:59 +0200
Message-ID: <2kj31qF2m3vfU1_at_uni-berlin.de>



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 Received on Thu Jul 01 2004 - 20:21:59 CEST

Original text of this message