1 / 32

Lecture 14 – ARIES Recovery

Lecture 14 – ARIES Recovery. 4/3/2013. WA,B. WC. 1. CRASH. WD. WA. 2. WB. WE. 3. CP. Flush. ARIES Example. WA,B. WC. 1. CRASH. WD. WA. 2. WB. WE. 3. CP. Flush. ARIES Data Structures. xactionTable. dirtyPgTable. Checkpoint. Disk. Crash Recovery. 3 Phases Analysis

warner
Download Presentation

Lecture 14 – ARIES Recovery

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 14 – ARIES Recovery 4/3/2013

  2. WA,B WC 1 CRASH WD WA 2 WB WE 3 CP Flush ARIES Example

  3. WA,B WC 1 CRASH WD WA 2 WB WE 3 CP Flush ARIES Data Structures xactionTable dirtyPgTable Checkpoint Disk

  4. Crash Recovery • 3 Phases • Analysis • Rebuild data structures • Determine winners & losers • Redo • “Repeat history” • Why? • Undo • Undo Losers

  5. Analysis

  6. Analysis Disk xactionTable dirtyPgTable

  7. Analysis Disk xactionTable dirtyPgTable

  8. Analysis Disk xactionTable dirtyPgTable

  9. Analysis Disk xactionTable dirtyPgTable

  10. Analysis Disk xactionTable dirtyPgTable

  11. Dirty page table doesn’t reflect true state on disk Analysis dirtyPgTable Disk xactionTable Losers

  12. Redo dirtyPgTable • Where to begin? • Checkpoint? • Min(recLSN)! • What to REDO • Everything? • Slow • Problematic if using operational (escrow) logging • Redo an update UNLESS: • Page is not in dirtyPgTable • Page flushed prior to checkpoint, didn’t redirty • If LSN < recLSN • Page flushed & redirtied prior to checkpoint • If LSN <= pageLSN • Page flushed after checkpoint Disk

  13. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk

  14. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk

  15. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk

  16. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk

  17. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk

  18. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk

  19. Redo Example DirtyPgTable • Redo UNLESS • Page is not in dirtyPgTable • If LSN < recLSN • If LSN <= pageLSN Disk State identical to pre-crash state

  20. Undo • Walk backwards, following prevLSNs to UNDO losers xactionTable

  21. Undo • Walk backwards, following prevLSNs to UNDO losers xactionTable

  22. Undo • Walk backwards, following prevLSNs to UNDO losers xactionTable • Why can we just blindly apply UNDOs?

  23. UNDO Wrinkles • Logical UNDO • Why? • “Compensation Log Records” -- CLRs • Avoid repeating UNDO work • Why?

  24. UNDO with CLR Losers: 3

  25. UNDO with CLR

  26. UNDO with CLR

  27. UNDO with CLR

  28. UNDO with CLR

  29. UNDO with CLR

  30. UNDO with CLR

  31. UNDO with CLR

  32. REDO with CLR • REDO CLRs on crash recovery • Use REDO rules to check if updates in CLRs have already been done • Avoids repeating operational (escrow) operations • After processing CLR, update lastLSN field in dirtyPgTable • Allows UNDO to start from the right place

More Related