Assignment 5 - Solution Problem 1

Slides:



Advertisements
Similar presentations
Two phase commit. Failures in a distributed system Consistency requires agreement among multiple servers –Is transaction X committed? –Have all servers.
Advertisements

CS542: Topics in Distributed Systems Distributed Transactions and Two Phase Commit Protocol.
(c) Oded Shmueli Distributed Recovery, Lecture 7 (BHG, Chap.7)
CS 603 Handling Failure in Commit February 20, 2002.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 12: Three-Phase Commits (3PC) Professor Chen Li.
Consensus Algorithms Willem Visser RW334. Why do we need consensus? Distributed Databases – Need to know others committed/aborted a transaction to avoid.
CIS 720 Concurrency Control. Timestamp-based concurrency control Assign a timestamp ts(T) to each transaction T. Each data item x has two timestamps:
Jan. 2014Dr. Yangjun Chen ACS Database recovery techniques (Ch. 21, 3 rd ed. – Ch. 19, 4 th and 5 th ed. – Ch. 23, 6 th ed.)
ICS 421 Spring 2010 Distributed Transactions Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/16/20101Lipyeow.
Termination and Recovery MESSAGES RECEIVED SITE 1SITE 2SITE 3SITE 4 initial state committablenon Round 1(1)CNNN-NNNN Round 2FAILED(1)-CNNN--NNN Round 3FAILED.
Transaction Processing Lecture ACID 2 phase commit.
Two phase commit. What we’ve learnt so far Sequential consistency –All nodes agree on a total order of ops on a single object Crash recovery –An operation.
Systems of Distributed Systems Module 2 -Distributed algorithms Teaching unit 3 – Advanced algorithms Ernesto Damiani University of Bozen Lesson 6 – Two.
Recovery Fall 2006McFadyen Concepts Failures are either: catastrophic to recover one restores the database using a past copy, followed by redoing.
Non-blocking Atomic Commitment Aaron Kaminsky Presenting Chapter 6 of Distributed Systems, 2nd edition, 1993, ed. Mullender.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
CS 603 Three-Phase Commit February 22, Centralized vs. Decentralized Protocols What if we don’t want a coordinator? Decentralized: –Each site broadcasts.
©Silberschatz, Korth and Sudarshan19.1Database System Concepts Distributed Transactions Transaction may access data at several sites. Each site has a local.
1 More on Distributed Coordination. 2 Who’s in charge? Let’s have an Election. Many algorithms require a coordinator. What happens when the coordinator.
1 ICS 214B: Transaction Processing and Distributed Data Management Distributed Database Systems.
Distributed Commit. Example Consider a chain of stores and suppose a manager – wants to query all the stores, – find the inventory of toothbrushes at.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
Commit Protocols. CS5204 – Operating Systems2 Fault Tolerance Causes of failure: process failure machine failure network failure Goals : transparent:
CS162 Section Lecture 10 Slides based from Lecture and
Distributed Transactions March 15, Transactions What is a Distributed Transaction?  A transaction that involves more than one server  Network.
Distributed Transactions Chapter 13
CSE 486/586 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Transaction Management, Fall 2002Lecture Distributed Commit Protocols Jyrki Nummenmaa
Fault Tolerance CSCI 4780/6780. Distributed Commit Commit – Making an operation permanent Transactions in databases One phase commit does not work !!!
University of Tampere, CS Department Distributed Commit.
Commit Algorithms Hamid Al-Hamadi CS 5204 November 17, 2009.
Distributed Transactions Chapter – Vidya Satyanarayanan.
Committed:Effects are installed to the database. Aborted:Does not execute to completion and any partial effects on database are erased. Consistent state:
Two-Phase Commit Brad Karp UCL Computer Science CS GZ03 / M th October, 2008.
Lampson and Lomet’s Paper: A New Presumed Commit Optimization for Two Phase Commit Doug Cha COEN 317 – SCU Spring 05.
Revisiting failure detectors Some of you asked questions about implementing consensus using S - how does it differ from reaching consensus using P. Here.
A client transaction becomes distributed if it invokes operations in several different Servers There are two different ways that distributed transactions.
Multi-phase Commit Protocols1 Based on slides by Ken Birman, Cornell University.
Antidio Viguria Ann Krueger A Nonblocking Quorum Consensus Protocol for Replicated Data Divyakant Agrawal and Arthur J. Bernstein Paper Presentation: Dependable.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Topics in Distributed Databases Database System Implementation CSE 507 Some slides adapted from Navathe et. Al and Silberchatz et. Al.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Database recovery techniques
More on Fault Tolerance
Introduction Many distributed systems require that participants agree on something On changes to important data On the status of a computation On what.
Recovery in Distributed Systems:
Two Phase Commit CSE593 Transaction Processing Philip A. Bernstein
Outline Introduction Background Distributed DBMS Architecture
Database System Implementation CSE 507
Two phase commit.
COS 418: Distributed Systems Lecture 6 Daniel Suo
Commit Protocols CS60002: Distributed Systems
RELIABILITY.
Outline Introduction Background Distributed DBMS Architecture
Outline Announcements Fault Tolerance.
2PC Recap Eventual Consistency & Dynamo
2PC Recap Eventual Consistency & Dynamo
Outline Introduction Background Distributed DBMS Architecture
CSE 486/586 Distributed Systems Concurrency Control --- 3
Distributed Transactions
Brahim Ayari, Abdelmajid Khelil, Neeraj Suri and Eugen Bleim
Exercises for Chapter 14: Distributed Transactions
Distributed Databases Recovery
Chapter 19: Distributed Transaction Recovery
UNIVERSITAS GUNADARMA
CIS 720 Concurrency Control.
CSE 486/586 Distributed Systems Concurrency Control --- 3
Last Class: Fault Tolerance
Transaction Communication
Presentation transcript:

Assignment 5 - Solution Problem 1   Problem 1 Consider a system that uses the two-phase commit protocol with the cooperative termination protocol and no other optimizations. Assuming there are two participants (P1 and P2) and a coordinator (C), for each of the following either describe an execution scenario or explain why it cannot happen: C P1 P2

C sends “prepare-to-commit” P1 & P2 send “yes-prepared” 1.A P1 and P2 are blocked. C sends “prepare-to-commit” P1 & P2 send “yes-prepared” C crashes, which leaves P1 and P2 blocked. C P1 P2

1.B. Only P2 is blocked. C sends “prepare-to-commit” P1 & P2 send “yes-prepared” Communication failure at P2 P1 and C terminate the protocol P1 and C crash P2 is blocked   P2 crashes P2 is recovers and is blocked

The coordinator can always unilaterally abort an undecided tx. 1.C C is blocked. This cannot happen. The coordinator can always unilaterally abort an undecided tx. C P1 P2

Problem 2 Suppose there are n processes involved in 2PC, where process 1 is the transaction’s home. Suppose the processes are arranged in a chain (NOT a ring), so that each process can only communicate with adjacent processes in the chain. That is, process 1 can communicate only with process 2, process n-1 can communicate only with process n, and for each i where 1<i<n, process i can communicate only with processes i-1 and i+1. 1 i-1 i i+1 N

2.A Devise a version of the 2PC protocol for this arrangement of processes that uses 2n – 2 messages to commit a transaction. Process 1 Starts the commit activity. Prepares, then sends a Request-to-Prepare to Process 2. Process 2 Prepares, then sends a Request-to-Prepare to 3. … Process n Receives a request to prepare It commits Sends a Commit message to n-1. 

2.b. In the protocol you devised in (a), is there any process that is never in an uncertainty period? Yes, Process n. 2.C In the protocol you devised in (a), what action commits the transaction? The log write of a commit record at process n effectively commits the transaction.

2.D Explain how to modify the protocol to speed up the protocol in the event that a process votes No. A process that votes No should send Abort to its two neighbors (if present), including lower and higher numbered processes. The lower-numbered neighbor should propagate the abort back toward process 1. The higher-numbered neighbor should propagate the abort up toward process n.