1 Formal Models for Distributed Negotiations The 2PC in an Extended Pi-Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela.

Slides:



Advertisements
Similar presentations
Impossibility of Distributed Consensus with One Faulty Process
Advertisements

Teaser - Introduction to Distributed Computing
6.852: Distributed Algorithms Spring, 2008 Class 7.
CS542: Topics in Distributed Systems Distributed Transactions and Two Phase Commit Protocol.
CS 603 Handling Failure in Commit February 20, 2002.
Nummenmaa & Thanish: Practical Distributed Commit in Modern Environments PDCS’01 PRACTICAL DISTRIBUTED COMMIT IN MODERN ENVIRONMENTS by Jyrki Nummenmaa.
CIS 720 Concurrency Control. Timestamp-based concurrency control Assign a timestamp ts(T) to each transaction T. Each data item x has two timestamps:
ICS 421 Spring 2010 Distributed Transactions Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/16/20101Lipyeow.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
Asynchronous Consensus (Some Slides borrowed from ppt on Web.(by Ken Birman) )
Systems of Distributed Systems Module 2 -Distributed algorithms Teaching unit 3 – Advanced algorithms Ernesto Damiani University of Bozen Lesson 6 – Two.
1 Formal Models for Distributed Negotiations Description Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
1 Formal Models for Distributed Negotiations Zero-Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
Non-blocking Atomic Commitment Aaron Kaminsky Presenting Chapter 6 of Distributed Systems, 2nd edition, 1993, ed. Mullender.
The Atomic Commit Problem. 2 The Problem Reaching a decision in a distributed environment Every participant: has an opinion can veto.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 12 Wenbing Zhao Department of Electrical and Computer Engineering.
1 Formal Models for Distributed Negotiations Workflows, BizTalk and ZSN Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias.
1 Formal Models for Distributed Negotiations Transactions in Linda Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias.
1 Formal Models for Distributed Negotiations Concurrent Languages Translation Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela.
Hernán Melgratti joint work with Roberto Bruni and Ugo Montanari Dipartimento di Informatica - Università di Pisa Flat Committed Join in Join.
Manajemen Basis Data Pertemuan 10 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
1 Formal Models for Distributed Negotiations Exercises Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
1 Distributed Databases CS347 Lecture 16 June 6, 2001.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
1 Static vs dynamic SAGAs Ivan Lanese Computer Science Department University of Bologna/INRIA Italy.
Formal Modeling of Concurrent Processes: PI and API Calculi Shahram Rahimi.
Distributed Systems 2006 Group Membership * *With material adapted from Ken Birman.
1 Formal Models for Transactions: Zero Safe Nets Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
1 Formal Models for Distributed Negotiations From Petri Nets to Join Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela.
©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 Formal Models for Transactions: BizTalk as ZSN Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and.
1 ICS 214B: Transaction Processing and Distributed Data Management Distributed Database Systems.
Distributed Systems Fall 2009 Distributed transactions.
1 Formal Models for Distributed Negotiations Introduction Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
1 Formal Models for Distributed Negotiations Commit Protocols Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas.
Commit Protocols. CS5204 – Operating Systems2 Fault Tolerance Causes of failure: process failure machine failure network failure Goals : transparent:
Distributed Commit Dr. Yingwu Zhu. Failures in a distributed system Consistency requires agreement among multiple servers – Is transaction X committed?
Distributed Transactions March 15, Transactions What is a Distributed Transaction?  A transaction that involves more than one server  Network.
DISTRIBUTED SYSTEMS II AGREEMENT (2-3 PHASE COM.) Prof Philippas Tsigas Distributed Computing and Systems Research Group.
Distributed Txn Management, 2003Lecture 3 / Distributed Transaction Management – 2003 Jyrki Nummenmaa
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
Chapter 19 Recovery and Fault Tolerance Copyright © 2008.
Distributed Transactions Chapter 13
Distributed Txn Management, 2003Lecture 4 / Distributed Transaction Management – 2003 Jyrki Nummenmaa
Consensus and Its Impossibility in Asynchronous Systems.
CSE 486/586 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
Distributed Transaction Management, Fall 2002Lecture Distributed Commit Protocols Jyrki Nummenmaa
University of Tampere, CS Department Distributed Commit.
Dipartimento di Informatica Università di Pisa Alberto Baragatti, Roberto Bruni, Hernán Melgratti, Ugo Montanari and Giorgio Spagnolo Prototype Platforms.
Commit Algorithms Hamid Al-Hamadi CS 5204 November 17, 2009.
CS294, Yelick Consensus revisited, p1 CS Consensus Revisited
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:
Consensus and leader election Landon Cox February 6, 2015.
Two-Phase Commit Brad Karp UCL Computer Science CS GZ03 / M th October, 2008.
IM NTU Distributed Information Systems 2004 Distributed Transactions -- 1 Distributed Transactions Yih-Kuen Tsay Dept. of Information Management National.
Multi-phase Commit Protocols1 Based on slides by Ken Birman, Cornell University.
Alternating Bit Protocol
Distributed Consensus
Commit Protocols CS60002: Distributed Systems
Outline Announcements Fault Tolerance.
Internet of Things A Process Calculus Approach
CSE 486/586 Distributed Systems Concurrency Control --- 3
Distributed Transactions
Distributed Databases Recovery
CIS 720 Concurrency Control.
CSE 486/586 Distributed Systems Concurrency Control --- 3
Presentation transcript:

1 Formal Models for Distributed Negotiations The 2PC in an Extended Pi-Calculus Roberto Bruni Dipartimento di Informatica Università di Pisa XVII Escuela de Ciencias Informaticas (ECI 2003), Buenos Aires, July

Formal Models for Distributed Negotiations2 Towards the End What should have emerged from this course? Dealing with distributed systems is not an easy task Current interests: Coordination, orchestration, choreography of concurrent and distributed processes/data Negotiations, contracts, agreements, committed choices (transactions in disguise) Formal models are essential to support rigorous analysis, specifications and proofs to support efficient implementations to develop new concepts to compare approaches

Formal Models for Distributed Negotiations3 One More Example To conclude our excursus 2PC in pi-calculus [Berger, Honda 2000] some extensions are needed to cover all the aspects of the protocol message loss sites local timers site failures persistence Atomicity can be formally expressed and proved Here main ideas are just sketched

Formal Models for Distributed Negotiations4 2PC (Again!) Informally 2PC protocol distributed faulty processes communicating on faulty channels unique TM (coordinator) finitely many participants (statically fixed) atomicity as far as outside observers are concerned with, it looks as if all participants commit/abort together

Formal Models for Distributed Negotiations5 2PC: Core Protocol Assuming the absence of failures: The coordinator sends vote requests to all participants Each participant sends its vote (abort/commit) back to the coordinator if the message is abort, the participant aborts immediately otherwise, the participant waits for the decision of the coordinator the coordinator itself can decide to vote commit/abort When all votes are collected if all voted commit, the coordinator tells all to commit otherwise, the coordinator tells all to abort All participants that voted commit were waiting for the decision and must behave accordingly

Formal Models for Distributed Negotiations6 2PC: Timers Since messages can be lost in transit, the core protocol is augmented with timeouts The coordinator sets a timer before waiting for votes if the times expires, the coordinator votes abort Each participant that voted commit sets a timer before waiting for the decision if the timer expires, the participant can assume that the message carrying the decision was lost and will request the coordinator to send the decision again (centralized version), setting up another timer

Formal Models for Distributed Negotiations7 2PC: Savepoints Systems/processes can crash all crashed systems will eventually restart to allow consistent restarting, savepoints are added to the protocol persistent datum S if P crashes it will restart as S The initial savepoint of the coordinator is such that, after restart, it will order participants to abort (crashed coordinators are not trustworthy) After the coordinator has received all votes and they are all for commit, the coordinator updates its savepoint to order commit if restarted, then sends the decision The initial savepoint of each participant is to abort After voting commit, the savepoint is updated to vote commit again and wait the decision, then sends its vote

Formal Models for Distributed Negotiations8 Pi-Calculus with Branching I Asynchronous pi-calculus (y abbreviates y 1,…,y n ) P ::= 0 | x  y  | x(y).P | ( x)P | P|P | !x  y  | !x(y).P Augmented with branching (to deal more conveniently with binary abort/commit decisions) P ::= … | x[(y).P,(z).P] | x-left  y  | x-right  y  Structural rules alpha-renaming of bound names _|_ is associative, commutative, with unit 0 ( x)( y)P  ( y)( x)P P|( x)Q  ( x) (P|Q) when x  fn(P) P|!P  !P

Formal Models for Distributed Negotiations9 Pi-Calculus with Branching II Reductions allowed in any context, unless under prefix defined up-to structural equivalence x(y).P | x  v   P{v/y} x[(y).P,(z).Q] | x-left  v   P{v/y} x[(y).P,(z).Q] | x-right  v   Q{v/z} Abbreviations x[P,Q], x-left, x-right (in absence of name passing) P  Q = ( c)(c.P|c.Q|c  ) (internal sum) P  Q  P’ ~ P and P  Q  Q’ ~ Q

Formal Models for Distributed Negotiations10 Pi-Calculus: Core Protocol 2PCP = ( vote self )( vote)( dec)( C | P 1 | … | P n ) C = ( c) ( c self ) ( a)( C wait | C commit | C abort | C self ) C wait = vote 1 [c 1 ,a  ] | … | vote n [c n ,a  ] | vote self [c self ,a  ] C self = vote self -left  vote self -right C commit = c 1. ….c n.c self.(dec 1 -left | … | dec n -left ) C abort = a.(dec 1 -right | … | dec n -right ) P i = Pc i  Pa i Pc i = vote i -left | dec i [!commit i , !abort i  ] Pa i = vote i -right | !abort i  Proposition 2PCP  Abort  Commit where Abort =  i !abort i  and Commit =  i !commit i 

Formal Models for Distributed Negotiations11 Modeling Message Loss Reduction x  y   0 ? unrealistic: not all messages can be lost only those traveling between different sites Two kinds of channels (lossy/reliable)? It is not the channel, it is the message that matters (local/remote) Augment the calculus with the notion of a site clear separation between internal and external message passing N ::= 0 | ( x)N | N|N | [P] A site ready to receive from channels in A

Formal Models for Distributed Negotiations12 Access Points [P] A as a LAN connected to the Internet A is the set of IP-addresses owned by hosts in the LAN [P] A as a host A is the set of sockets serviced by P In general A is the set of access points of [P] A ap(0) =  ap(( x)N ) = ap(N) - {x} ap(N|M) = ap(N)  ap(M) ap([P] A ) = A

Formal Models for Distributed Negotiations13 Well-Formed Sites Local processes Given P=x(y).Q x occurs in P as input subject free occurrences of y in Q are said input-bound P is local if no input subject is input bound Well-formed sites (written |- N ) |- 0 |- ( x)N if |- N |- N|M if |- N and |- M and ap(N)  ap(M)=  |- [P] A if P is local and each free input subject of P is in A

Formal Models for Distributed Negotiations14 More on Sites We consider well-formed sites only Overloaded operators 0, ( x) and | obey the same structural rules as those for processes In addition we assume [( x)P] A  ( x)[P] A  {x} Reductions usual reductions are all allowed intra sites [P|x  v  ] A  [P] A if x  A (message loss) [P|x(y).P’] A | [Q|x  v  ] B  [P|P’{v/y}] A | [Q] B (network communication) … (network branching)

Formal Models for Distributed Negotiations15 Modeling Timers If messages can vanish, then the core protocol can easily deadlock (e.g. loss of a decision message) Timers are fundamental for preventing infinite wait Augment the calculus with the notion of a timer P ::= … | timer t (R,Q) where t ranges over integers greater than 0 represents the clock ticks left before the timer expires R is input-guarded time-in continuation Q is the time-out continuation

Formal Models for Distributed Negotiations16 Timer Stepper Function  (P) ticks each timer in P by one discrete unit  (timer t+1 (R,Q)) = timer t (R,Q) if t  1  (timer t (R,Q)) = Q if t  1  (R|Q) =  (R)|  (Q)  (( x)R) = ( x)  (R)  (P) = P otherwise Note that timers under guarding prefixes (and replication) Each site has its local time When time advance, it progresses for all timers in a site In different sites, time can advance separately

Formal Models for Distributed Negotiations17 Time Passing Reductions timer t+1 (x(y).P,Q) | x  v   P{v/y} (time-in) P   (P) (idle tick) we can no longer freely reduce under | P|R  Q|  (R) if P  Q (local time)

Formal Models for Distributed Negotiations18 Modeling Savepoints In centralized systems there is no notion of partial failure If the system crashes, the whole computation ends In distributed systems, partial failure is a key characteristic Persistent memory, unaffected by failures to store savepoints to recover computations We allow processes themselves to be savepoints We assume failures cannot take place during an interaction failures occur either before or after the action of receiving a message is atomic

Formal Models for Distributed Negotiations19 Pi-Calculus with Savepoints Augment processes P ::= … | save  P .Q Augment sites N ::= … | [P] A,Q | [*] A,Q [P] A,Q is a site containing P with latest savepoint Q [*] A,Q is a crashed site with latest savepoint Q Well-formed sites |- [P] A,Q if P and Q are local and each free input subject of P and Q is in A |- [*] A,Q if Q is local and each free input subject of Q is in A

Formal Models for Distributed Negotiations20 Saving and Restarting Reductions [P|save  Q .R] A,S  [P|R] A,Q (save) [P] A,Q  [*] A,Q (stop) [*] A,Q  [Q] A,Q (restart) Weak and strong bisimilarities are suitably extended they are congruences for networks, but not for processes See the paper for the whole protocol

Formal Models for Distributed Negotiations21 Recap We have seen Modeling 2PC in PDL pi-calculus Useful extensions Advantages

Formal Models for Distributed Negotiations22 References The two-phase commitment protocol in an extended pi-calculus (Proc. EXPRESS’00, ENTCS 39) M. Berger, K. Honda Towards abstractions for distributed systems (PhD Thesis, Imperial College, Department of Computing) M. Berger