lec25 - Logging and Recovery Chapter 16.7 18 EECS 484...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 1 Logging and Recovery Chapter 16.7, 18 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 2 Logging and Recovery The world isn’t perfect… Systems crash Devices (and even entire data centers!) fail Transactions abort Need to design DBMS to be resilient to these problems! Three main challenges: Aborted Transactions System Crashes: Lose the contents of RAM Media Failures: Lose data stored on one or more secondary devices (e.g., disks or tapes)
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 3 Maintaining ACID on Failure Atomicity Transactions may abort; need to undo actions Durability Committed Xacts should persist Desired Behavior after system restarts: T1 & T2 should be durable. T3, T4 & T5 should disappear entirely T1 T2 T3 T4 T5 crash A B C B C B B B 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 4 Agenda Focus on recovering from system crashes Lose the contents of RAM (buffer pool) Need to completely undo the effects of all incomplete transactions Make sure committed transactions persist What makes this hard? Steal / No-Force Buffer Management Policy ARIES Recovery Protocol Breakthrough in modern systems
Image of page 2
3 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 5 Buffer Manager & Transactions Can changes made to object O by transaction T be written to disk before T commits? If yes, called a steal approach When transaction T commits, do we need to assume all changes immediately forced to disk? If yes, called a force approach 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 6 Buffer Manager & Transactions No Force Problem: Crash before a page is flushed to disk Force Poor performance Force Steal Yes No No Yes Steal Problem: Page being stolen (and flushed) was modified by an uncommitted transaction No Steal Poor performance Desired Trivial Challenge: How to provide atomicity and durability in a steal, no force environment?
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 7 Basic Solution Idea: Logging Every time a change is made, record information in an append-only log . Log stored in stable storage to survive system crash Update log records describe changes that were made, and how to UNDO / REDO them E.g., before/after images Each log record contains log sequence number (LSN) prevLSN, XID Log records for a transaction are chained by prevLSN 4/10/11 EECS 484: Database Management Systems, Kristen LeFevre 8 Write-Ahead Logging (WAL) The Write-Ahead Logging Protocol: 1. Must force the log record for an update before the corresponding data page gets to disk.
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern