CS 347: Parallel and Distributed Data Management Notes 11: Network Partitions Hector Garcia-Molina CS347 Notes11.

Slides:



Advertisements
Similar presentations
Serializability in Multidatabases Ramon Lawrence Dept. of Computer Science
Advertisements

Copyright 2004 Koren & Krishna ECE655/DataRepl.1 Fall 2006 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Fault Tolerant Computing.
Replication Management. Motivations for Replication Performance enhancement Increased availability Fault tolerance.
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.
CS 582 / CMPE 481 Distributed Systems
CS 245Notes 101 CS 245: Database System Principles Notes 10: More TP Hector Garcia-Molina.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 15: Data Replication with Network Partitions & Transaction Processing Systems.
The Atomic Commit Problem. 2 The Problem Reaching a decision in a distributed environment Every participant: has an opinion can veto.
1 ICS 214B: Transaction Processing and Distributed Data Management Replication Techniques.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
CS 347Notes 041 CS 347: Distributed Databases and Transaction Processing Notes04: Query Optimization Hector Garcia-Molina.
Manajemen Basis Data Pertemuan 10 Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
1 Distributed Databases CS347 Lecture 16 June 6, 2001.
Reliability and Partition Types of Failures 1.Node failure 2.Communication line of failure 3.Loss of a message (or transaction) 4.Network partition 5.Any.
Distributed Databases
6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.
Rule Generation [Chapter ]
CS162 Section Lecture 10 Slides based from Lecture and
A small country has 4 provinces – A, B, C and D. Each province contains 30%, 20%, 10% and 40% of the population in the country, respectively. The.
Replication March 16, Replication What is Replication?  A technique for increasing availability, fault tolerance and sometimes, performance 
CS 245Notes 101 CS 245: Database System Principles Notes 10: More TP Hector Garcia-Molina.
Consensus and Its Impossibility in Asynchronous Systems.
Examples. Examples (1/11)  Example #1: f(A,B,C,D) =  m(2,3,4,5,7,8,10,13,15) Fill in the 1’s. 1 1 C A B CD AB D 1 1.
IM NTU Distributed Information Systems 2004 Replication Management -- 1 Replication Management Yih-Kuen Tsay Dept. of Information Management National Taiwan.
Commit Algorithms Hamid Al-Hamadi CS 5204 November 17, 2009.
(2 + 1) + 4 = 2 + (1 + 4) Associative Property of Addition.
Properties Associative, Commutative and Distributive.
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
Antidio Viguria Ann Krueger A Nonblocking Quorum Consensus Protocol for Replicated Data Divyakant Agrawal and Arthur J. Bernstein Paper Presentation: Dependable.
(2 + 1) + 4 = 2 + (1 + 4) Associative Property of Addition.
Highly Available Services and Transactions with Replicated Data Jason Lenthe.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Transactions on Replicated Data Steve Ko Computer Sciences and Engineering University at Buffalo.
Election Theory A Tale of Two Countries or Voting Power Comes To the Rescue!
CS 540 Database Management Systems NoSQL & NewSQL Some slides due to Magda Balazinska 1.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Set. Outline Universal Set Venn Diagram Operations on Sets.
CS 245: Database System Principles Notes 10: More TP
CS 347: Parallel and Distributed Data Management Notes07: Data Replication Hector Garcia-Molina CS 347 Notes07.
Recovery Control (Chapter 17)
CS 440 Database Management Systems
Lesson 2.9 Objective: Probability permutations and combinations
Outline Introduction Background Distributed DBMS Architecture
6.4 Data and File Replication
Two phase commit.
Lecture 3 Algebraic Simplification
Frequent Pattern Mining
Properties of Addition and Multiplication
Dynamic Itemset Counting
تصنيف التفاعلات الكيميائية
Commit Protocols CS60002: Distributed Systems
CS 440 Database Management Systems
Outline Announcements Fault Tolerance.
Design and Analysis of Multi-Factored Experiments
CS 245: Database System Principles Notes 10: More TP
Reliable Distributed Systems
Fractional Factorial Design
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Distributed Transactions
Exploring Partially ordered sets
CPSC-608 Database Systems
Distributed Databases Recovery
EEC 688/788 Secure and Dependable Computing
Vectors (2).
Design matrix Run A B C D E
CIS 720 Concurrency Control.
Properties of Numbers Review Problems.
Copyright 2004 Koren & Krishna ECE655/DataRepl.1 Fall 2006 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Fault Tolerant Computing.
Presentation transcript:

CS 347: Parallel and Distributed Data Management Notes 11: Network Partitions Hector Garcia-Molina CS347 Notes11

Network partitions Groups of nodes may be isolated or nodes may be slow in responding P Net P CS347 Notes11

Where are partitions of interest? True network partitions (disaster) Single node failure cannot be distinguished from partition (e.g., ethernet board fails) Phone-in, wireless networks Autonomous nodes CS347 Notes11

No data replication If data unavailable, we are stuck… A problem: partition during commit protocol A C CS347 Notes11

Quorums C1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} A1 = {{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d}} Important property: XC1  YA1 XYØ YA1  XC1 XYØ CS347 Notes11

Additional Properties for Quorums? added C1 = {{a,b,c,d}, {a,b,d}, {a,c,d}, {b,c,d}} A1 = {{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d}} Is there a “better” quorum? CS347 Notes11

Quorums can be implemented with vote assignments To commit  3 To abort  2 Votes to commit + votes to abort > total votes 1 . a b . . c 1 1 . d 1 CS347 Notes11

Commit protocol must enforce quorum . b a . . c . d If node knows transaction could have committed (aborted), it cannot abort (commit) even if abort (commit) quorum available All commit protocols are blocking (with network partitions) can we do anything about it? CS347 Notes11

3PC Example To make commit decision: commit quorum To make abort decision: abort quorum Example: votes for commit VC = 3 votes for abort VA = 3 1 w old coordinator 2 1 w 1 w new coordinator CS347 Notes11

Coordinator could NOT have committed Have abort quorum  Try to abort! VC = 3; VA = 3 1 w old coordinator 2 1 w 1 w new coordinator Coordinator could NOT have committed Have abort quorum  Try to abort! CS347 Notes11

Note: need to go to Prepare to Abort state (PA), analogous to Prepare to Commit state (PC) 1 w w PA PA PA A A 1 1 time CS347 Notes11

What if new group has following states? 1 w PC PA 1 1 CS347 Notes11

What if new group has following states? 1 w PC PA 1 1 Can this happen? How? Could transaction have aborted? Could transaction have committed? What do we do? Block? CS347 Notes11

Another 3PC Example VC = 3; VA = 3 1 P old coordinator 2 1 w 1 w new coordinator CS347 Notes11

Another 3PC Example Coordinator could not have aborted VC = 3; VA = 3 1 P old coordinator 2 1 w 1 w new coordinator Coordinator could not have aborted Have commit quorum  Try to commit! CS347 Notes11

Yet Another 3PC Example VC = 3; VA = 3 1 P old coordinator 2 1 w new coordinator 1 w CS347 Notes11

Yet Another 3PC Example Not enough votes!  Block! VC = 3; VA = 3 1 P old coordinator 2 1 w new coordinator 1 w Not enough votes!  Block! CS347 Notes11

Not all quorums can be implemented via votes C2 = {{a,b}, {c,d}} A2 = {{a,c}, {a,d}, {b,c}, {b,d}} b a d c CS347 Notes11

Partitions and data replication Options: (1) all copies required for updates (2) Group may update, but at most one (at a time) (3) Any group may update CS347 Notes11

Updates by at most one group . c Coterie C1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} C2 = {{a,b}, {a,c}, {a,d}, {b,c,d}} X1= {{a,b}, {c,d}} not valid Important property: SC  GC, SGØ . d CS347 Notes11

Reading replicated data b . . c . d C1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} R1 = {{a,b}, {a,c}, {a,d},{b,c}, {b,d}, {c,d}} C2 = R2 = {{a,b}, {a,c}, {a,d}, {b,c,d}} CS347 Notes11

Reading replicated data - Votes C1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} R1 = {{a,b}, {a,c}, {a,d},{b,c}, {b,d}, {c,d}} 1 to write get 3 votes (Vw) to read get 2 votes (VR) (2 Vw > T, Vw + VR > T) . a b . . c 1 1 . d 1 CS347 Notes11

Reading replicated data - Votes C2 = R2 = {{a,b}, {a,c}, {a,d}, {b,c,d}} 2 to write get 3 votes (Vw) to read get 3 votes (VR) (2 Vw > T, Vw + VR > T) . a b . . c 1 1 . d 1 CS347 Notes11

Incidentally, which one is “better”? C1 = {{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}} R1 = {{a,b}, {a,c}, {a,d},{b,c}, {b,d}, {c,d}} C2 = R2 = {{a,b}, {a,c}, {a,d}, {b,c,d}} CS347 Notes11

Note Note: not all coteries have vote assignments CS347 Notes11

Note Note: not all coteries have vote assignments Nodes = {a,b,c,d,e,f} C = { {a,b}, {a,c,d}, {a,c,e}, {a,d,f}, {a,e,f}, {b,c,f}, {b,d,e} } CS347 Notes11

A Problem Example: a 3 node system, 1 vote each node, replicated data Now: T1 . a T1 is committed at a,b T1 . b . c CS347 Notes11

Later: T1 . a T2 reads at c (not seeing T1); . b . c then writes and commits at a, c CS347 Notes11

Solution each node keeps list of committed transactions compare list at read site with those at write sites update sites that missed transactions CS347 Notes11

Example Revisited Initially T0,T1 . a T0,T1 . b . c T0 CS347 Notes11

T0,T1 . a T2 Coordinator T0,T1 . b . C READ List = T0 T0 CS347 Notes11

T0,T1 . a T2 T0,T1 . b . C “EXEC” List = T0 “EXEC” List = T0 T0 CS347 Notes11

T0,T1 . a T2 T0,T1 . b . C Get new data(T1) from a! T0 NOK! CS347 Notes11

Each node must keep updates for transactions until all nodes have seen them - interesting problem... CS347 Notes11

Separate Operational Groups DB3 DBo DB1 DB4 DB2 CS347 Notes11

For integration (1) Compensate transactions to make schedules match (2) Data-patch: semantic fix CS347 Notes11

Example: compensation T0, T1, T2 DB3 DB1 T0 DB2 T0, T3, T4 CS347 Notes11

Say T1 commutes with T3 and T4 E.g.: no conflicting operations At DB2: Schedule = T0, T3, T4, T1 (equivalent to T0, T1, T3, T4) T0, T1, T2 DB3 DB1 T0 DB2 T0, T3, T4 CS347 Notes11

At DB3: DB3 DB1 DB4 DB2 Schedule = T0, T1, T2, T2-1, T3, T4 (equivalent to T0, T1, T3, T4) T0, T1, T2 DB3 DB1 T0 DB4 T0, T1, T3, T4 DB2 T0, T3, T4 CS347 Notes11

Based on characteristics of transactions, can “merge” schedules In general: Based on characteristics of transactions, can “merge” schedules CS347 Notes11

Example: Data Patch - forget schedules! - integrate differing values via “rules” site 1 x y z c d ts=11 both copies 6 x y z a b ts=10 site 2 5 x y z e f ts=12 6 CS347 Notes11

Simple rules For X: site 1 wins For Y: latest timestamp wins For Z: add increments CS347 Notes11

For Y: latest timestamp wins For Z: add increments For X: site 1 wins For Y: latest timestamp wins For Z: add increments site 1 x y z c d ts=11 both copies (integrated) both copies 7 x y z a x y z c b ts=10 site 2 f ts=12 5 x y z 8 e f ts=12 6 for Z: 8 = 5 + site 1 increment + site 2 increment = 5 + 2 + 1 CS347 Notes11

Network Partitions: Summary No replicated data abort, commit quorums commit protocols Replicated data at most one operational group coterie propagation of updates multiple operational groups CS347 Notes11