数据库课件lec12recovery幻灯片.ppt

  1. 1、本文档共29页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
7 Crash Recovery Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides Review: The ACID properties Atomicity: All actions in the Xact (transaction) happen, or none happen. Consistency: If each Xact is consistent, and the DB starts consistent, it ends up consistent. Isolation: Execution of one Xact is isolated from that of other Xacts. Durability: If an Xact commits, its effects persist. The Recovery Manager guarantees Atomicity Durability. Motivation Atomicity: Transactions may abort (“Rollback”). Durability: What if DBMS stops running? (Causes?) crash! Desired state after system restarts: T1 T3 should be durable. T2, T4 T5 should be aborted (effects should not be seen). T1 T2 T3 T4 T5 Abort Commit Commit Assumptions Concurrency control is in effect. Strict 2PL, in particular. Updates are happening “in place”. i.e., data is overwritten on (deleted from) the disk. Atomic Writes: writing a page to disk is an atomic action. In practice, additional details are needed to deal with non-atomic writes. Buffer Management Policy Plays a Key Role Shall we allow “dirty pages” in the buffer pool caused by an Xact T to be written to disk before T commits? If so, a second Xact T can “steal” a frame from T. In contrast, No-Steal. When an Xact T commits, must we ensure that all the “dirty pages” of T are immediately forced to disk? If so, we say that a “force” approach is used. In contrast, No-Force. Variants of Buffer Management Policy Force No Force No Steal Steal No REDO No UNDO UNDO No REDO UNDO REDO No UNDO REDO Force No Force No Steal Steal Slowest Fastest Performance Implications Logging/Recovery Implications Preferred Policy: Steal/No-Force STEAL (why enforcing Atomicity is hard) To steal frame F: Current page in F (say P) is written to disk; some Xact holds lock on P. What if the Xact with the lock on P aborts? Must remember the old value of P at steal time (to support UNDOing the write to page P). NO FOR

文档评论(0)

开心农场 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档