1 / 30

ARIES Example

WA,B. WC. 1. CRASH. WD. WA. 2. WB. WE. 3. CP. Flush. ARIES Example. ARIES - What is Logged. “Physiological Logging” REDO Records Updates to data pages and index pages are logged separately But may use operational logging (e.g., INCREMENT/DECREMENT)

Download Presentation

ARIES Example

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. WA,B WC 1 CRASH WD WA 2 WB WE 3 CP Flush ARIES Example

  2. ARIES - What is Logged • “Physiological Logging” • REDO Records • Updates to data pages and index pages are logged separately • But may use operational logging (e.g., INCREMENT/DECREMENT) • Because escrow locks allow multiple writers • UNDO Records are Purely Logical • Only one record for index and data pages • May use operational logging

  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. Not the same as just before crash (note disk state) 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: 1. 2. 3. 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. REDO with CLR • REDO CLRs on crash recovery • Use REDO rules to check if updates in CLRs have already been done • After processing CLR, update lastLSN field in dirtyPgTable to point to prevLSN of CLR • Allows UNDO to start from the right place

More Related