1 / 14

Multi-phase Commit Protocols

Multi-phase Commit Protocols. Based on slides by Ken Birman, Cornell University. Failure model impacts costs!. Byzantine model is very costly: 3 f +1 processes needed to overcome f failures, protocol runs in f +1 rounds

yagil
Download Presentation

Multi-phase Commit Protocols

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. Multi-phase Commit Protocols Based on slides by Ken Birman, Cornell University Multi-phase Commit Protocols

  2. Failure model impacts costs! • Byzantine model is very costly: 3f+1 processes needed to overcome f failures, protocol runs in f+1 rounds • This cost is unacceptable for most real systems, hence protocols are rarely used • Main area of application: hardware fault-tolerance, security systems Multi-phase Commit Protocols

  3. Commit with simpler failure model • Assume processes fail by halting • Coordinator detects failures (unreliably) using timouts. It can make mistakes! • Now the challenge is to terminate the protocol if the coordinator fails instead of, or in addition to, a participant! Multi-phase Commit Protocols

  4. Commit protocol illustrated ok to commit? ok with us crashed! … times outabort! Note: garbage collection protocol not shown here Multi-phase Commit Protocols

  5. Example of a hard scenario • Coordinator starts the protocol • One participant votes to abort, all others to commit • Coordinator and one participant now fail ... we now lack the information to correctly terminate the protocol! Multi-phase Commit Protocols

  6. Commit protocol illustrated ok to commit? vote unknown! ok decision unknown! ok Multi-phase Commit Protocols

  7. Example of a hard scenario • Problem is that if coordinator told the failed participant to abort, all must abort • If it voted for commit and was told to commit, all must commit • Surviving participants can’t deduce the outcome without knowing how failed participant voted • Thus protocol “blocks” until recovery occurs Multi-phase Commit Protocols

  8. Skeen (’82): Three-phase commit • Seeks to increase availability • Makes an unrealistic assumption that failures are accurately detectable • With this, can terminate the protocol even if a failure does occur Multi-phase Commit Protocols

  9. Three-phase commit • Coordinator starts protocol by sending request • Participants vote to commit or to abort • Coordinator collects votes, decides on outcome • Coordinator can abort immediately • To commit, coordinator first sends a “prepare to commit” message • Participants acknowledge, commit occurs during a final round of “commit” messages Multi-phase Commit Protocols

  10. ok to commit? prepare to commit commit Three phase commit protocol illustrated ok .... prepared... Note: garbage collection protocol not shown here Multi-phase Commit Protocols

  11. Observations about 3PC • If any process is in “prepare to commit” all voted for commit • Protocol commits only when all surviving processes have acknowledged prepare to commit • After coordinator fails, it is easy to run the protocol forward to commit state (or back to abort state) Multi-phase Commit Protocols

  12. Assumptions about failure • If the coordinator suspects a failure, the failure is “real” and the faulty process, if it later recovers, will know it was faulty • Failures are detectable with bounded delay • On recovery, process must go through a reconnection protocol to rejoin the system! (Find out status of pending transactions that terminated while it was not operational) Multi-phase Commit Protocols

  13. Problems with 3PC • With realistic failure detectors (that can make mistakes), protocol still blocks! • Bad case arises during “network partitioning” when the network splits the participating processes into two or more sets of operational processes • Can prove that this problem is not avoidable: there are no non-blocking commit protocols for asynchronous networks Multi-phase Commit Protocols

  14. Situation in practical systems • Most use protocols based on 2PC: 3PC is more costly and ultimately, still subject to blocking! • Need to extend with a form of garbage collection to avoid accumulation of protocol state information (can occur in the background) • Some systems simply accept the risk of blocking when a failure occurs • Others reduce the consistency property to make progress at risk of inconsistency after failure. Multi-phase Commit Protocols

More Related