1 CS 194: Lecture 9 Bayou Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences University.

Slides:



Advertisements
Similar presentations
Eventual Consistency Jinyang. Sequential consistency Sequential consistency properties: –Latest read must see latest write Handles caching –All writes.
Advertisements

1 CS 194: Elections, Exclusion and Transactions Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
Replication. Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
Replication Management. Motivations for Replication Performance enhancement Increased availability Fault tolerance.
1 CS 194: Lecture 8 Consistency and Replication Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
L-11 Consistency 1. Important Lessons Replication  good for performance/reliability  Key challenge  keeping replicas up-to-date Wide range of consistency.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Replication Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
1 CS 194: Lecture 10 Bayou, Brewer, and Byzantine.
Computer Science Lecture 16, page 1 CS677: Distributed OS Last Class: Web Caching Use web caching as an illustrative example Distribution protocols –Invalidate.
CS 582 / CMPE 481 Distributed Systems
“Managing Update Conflicts in Bayou, a Weakly Connected Replicated Storage System ” Distributed Systems Κωνσταντακοπούλου Τζένη.
1 CS 194: Lecture 15 Midterm Review. 2 Notation  Red titles mean start of new topic  They don’t indicate increased importance…..
Flexible Update Propagation for Weakly Consistent Replication Karin Petersen, Mike K. Spreitzer, Douglas B. Terry, Marvin M. Theimer and Alan J. Demers.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
G Robert Grimm New York University Bayou: A Weakly Connected Replicated Storage System.
Ordering of events in Distributed Systems & Eventual Consistency Jinyang Li.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Client-Centric.
Managing Update Conflicts in Bayou, a Weakly Connected Replicated Storage System D. B. Terry, M. M. Theimer, K. Petersen, A. J. Demers, M. J. Spreitzer.
Mobility Presented by: Mohamed Elhawary. Mobility Distributed file systems increase availability Remote failures may cause serious troubles Server replication.
Multicast Communication Multicast is the delivery of a message to a group of receivers simultaneously in a single transmission from the source – The source.
6.4 Data and File Replication Gang Shen. Why replicate  Performance  Reliability  Resource sharing  Network resource saving.
Distributed Deadlocks and Transaction Recovery.
1 CS 268: Lecture 19 A Quick Survey of Distributed Systems 80 slides in 80 minutes!
1 6.4 Distribution Protocols Different ways of propagating/distributing updates to replicas, independent of the consistency model. First design issue.
Mobility in Distributed Computing With Special Emphasis on Data Mobility.
Feb 7, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
1 CS 268: Lecture 20 Classic Distributed Systems: Bayou and BFT Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
Feb 7, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements Tomorrow’s class is officially cancelled. If you need someone to go over the reference implementation.
Bayou. References r The Case for Non-transparent Replication: Examples from Bayou Douglas B. Terry, Karin Petersen, Mike J. Spreitzer, and Marvin M. Theimer.
Replication and Consistency. Reference The Dangers of Replication and a Solution, Jim Gray, Pat Helland, Patrick O'Neil, and Dennis Shasha. In Proceedings.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Data Versioning Lecturer.
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
1 Transactions Chapter Transactions A transaction is: a logical unit of work a sequence of steps to accomplish a single task Can have multiple.
Consistency and Replication. Replication of data Why? To enhance reliability To improve performance in a large scale system Replicas must be consistent.
IM NTU Distributed Information Systems 2004 Replication Management -- 1 Replication Management Yih-Kuen Tsay Dept. of Information Management National Taiwan.
CSE 486/586 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
1 Multiversion Reconciliation for Mobile Databases Shirish Hemanath Phatak & B.R.Badrinath Presented By Presented By Md. Abdur Rahman Md. Abdur Rahman.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Write Conflicts in Optimistic Replication Problem: replicas may accept conflicting writes. How to detect/resolve the conflicts? client B client A replica.
Bayou: Replication with Weak Inter-Node Connectivity Brad Karp UCL Computer Science CS GZ03 / th November, 2007.
CSE 486/586 Distributed Systems Consistency --- 3
Consistency and Replication Chapter 6 Presenter: Yang Jie RTMM Lab Kyung Hee University.
Eventual Consistency Jinyang. Review: Sequential consistency Sequential consistency properties: –All read/write ops follow some total ordering –Read must.
Highly Available Services and Transactions with Replicated Data Jason Lenthe.
Mobility Victoria Krafft CS /25/05. General Idea People and their machines move around Machines want to share data Networks and machines fail Network.
CSE 486/586 Distributed Systems Consistency --- 2
Nomadic File Systems Uri Moszkowicz 05/02/02.
CSE 486/586 Distributed Systems Consistency --- 2
CSE 486/586 Distributed Systems Consistency --- 1
Lecturer : Dr. Pavle Mogin
Consistency and Replication
6.4 Data and File Replication
Consistency and Replication
CSE 486/586 Distributed Systems Consistency --- 3
EECS 498 Introduction to Distributed Systems Fall 2017
CSE 486/586 Distributed Systems Consistency --- 1
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Outline The Case for Non-transparent Replication: Examples from Bayou Douglas B. Terry, Karin Petersen, Mike J. Spreitzer, and Marvin M. Theimer. IEEE.
Replica Placement Model: We consider objects (and don’t worry whether they contain just data or code, or both) Distinguish different processes: A process.
Last Class: Web Caching
EEC 688/788 Secure and Dependable Computing
CSE 486/586 Distributed Systems Consistency --- 2
CSE 486/586 Distributed Systems Consistency --- 3
CSE 486/586 Distributed Systems Consistency --- 1
Presentation transcript:

1 CS 194: Lecture 9 Bayou Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA

2 Don’t Worry, Reality is on its Way!  Theory part of course is almost over  After midterm, will talk more about real systems  Are currently revising the lecture plan

3 Agenda  Review of last lecture  A really bad joke  The Bayou system

4 Purpose of Review  Bring all our timestamps up to current  If you don’t understand something, please ask  If you want an example, ask (and I’ll try)

5 Transactions, then Replication  Transactions: -One copy of data -Transactions = set of operations -Multiple transactions, each over many data items -Locking policies  Replication: -Many copies of data -Multiple operations -Not focusing on transactions, replication by itself is hard enough

6 Replication  Why replication? -Volume, Proximity, Availability  What not replication? -Replicas must be kept consistent (why?) -Overhead of keeping them consistent sometimes outweighs benefit of replication

7 Many Kinds of Consistency  Strict  Linearizable  Sequential (~serializable)  Causal  FIFO

8 Examples  What are some examples of replicated systems?  What kinds of consistency do they offer?

9 Focus on Sequential Consistency  Weakest model of consistency in which data items had to converge to the same value everywhere

10 Consistency Mechanisms  Local caching: push/pull/lease -Role of multicast in making push easier -Often under client control, consistency can be tuned to user needs  Primary copy: serialize at master -Local or remote reads (only remote reads support transactions)  Quorums: -Assign votes to replicas -Can only read/write when have read/write quorum

11 Scaling  None of these protocols scale  To read or write, you have to either -Contact a primary copy -Contact over half the replicas  Gray et al. model the scaling behavior of distributed trans.: -Deadlock ~n 3

12 Is Sequential Consistency Overkill?  Sequential consistency requires that at each stage in time, the operations at a replica occur in the same order as at every other replica  Ordering of writes causes the scaling problems!  Why insist on such a strict order?

13 Eventual Consistency  If all updating stops then eventually all replicas will converge to the identical values  Furthermore, the value towards which these values converge has sequential consistency of writes.

14 Implementing Eventual Consistency  All writes eventually propagate to all replicas  Writes, when they arrive, are applied in the same order at all replicas -Easily done with timestamps

15 Update Propagation  Rumor or epidemic stage: -Attempt to spread an update quickly by contacting peers -Willing to tolerate incompletely coverage in return for reduced traffic overhead -Push/Pull distinction  Correcting omissions: -Making sure that replicas that weren’t updated during the rumor stage get the update -Anti-entropy exchanges: comparison of full databases  Death certificates: needed for deleted items

16 Bayou

17 Why Should You Care about Bayou?  Changed the paradigm  Subset incorporated into next-generation WinFS  Done by my friends -I always thought it was a silly project…..

18 System Assumptions  Early days: nodes always on when not crashed -Bandwidth always plentiful (often LANs) -Never needed to work on a disconnected node -Nodes never moved -Protocols were “chatty”  Now: nodes detach then reconnect elsewhere -Even when attached, bandwidth is variable -Reconnection elsewhere means often talking to different replica -Work done on detached nodes

19 Disconnected Operation  Challenge to old paradigm -Standard techniques disallowed any operations while disconnected -Or disallowed operations by others  But eventual consistency not enough -Reconnecting to another replica could result in strange results E. g., not seeing your own recent writes -Merely letting latest write prevail may not be appropriate -No detection of read-dependencies  What do we do?

20 Bayou  System developed at PARC in the mid-90’s  First coherent attempt to fully address the problem of disconnected operation  Several different components  But first, why did they call it “Bayou”?

21 What’s a Bayou?  A body of water, such as a creek or small river, that is a tributary of a larger body of water.  A sluggish stream that meanders through lowlands, marshes, or plantation grounds.

22 Possible Explanations*  Bayous are ubiquitous, and Bayou supports ubiquitous computation (ubicomp)  Bayou provides “fluid” replication  Allows operation when you are “bayou self”  Pronounced Bi-U, which makes it Ubi spelled backwards  *All stolen from Alper Mizrak (UCSD)

23 Homework for Next Class  me one bad joke (which I can use in my lectures)  New intermission tradition: -Introduce yourself -Tell a joke  Best joke (according to me) gets a pound of chocolate  No joke, and you flunk….

24 Motivating Scenario: Shared Calendar  Calendar updates made by several people -e.g., meeting room scheduling, or exec+admin  Want to allow updates offline  But conflicts can’t be prevented  Two possibilities: -Disallow offline updates? -Conflict resolution?

25 Conflict Resolution  Replication not transparent to application -Only the application knows how to resolve conflicts -Application can do record-level conflict detection, not just file-level conflict detection -Calendar example: record-level, and easy resolution  Split of responsibility: -Replication system: propagates updates -Application: resolves conflict  Optimistic application of writes requires that writes be “undo-able”

26 Meeting room scheduler Reserve same room at same time: conflict Reserve different rooms at same time: no conflict Reserve same room at different times: no conflict Only the application would know this! Rm2 Rm1 time No conflict

27 Meeting Room Scheduler Rm2 Rm1 time No conflict

28 Meeting Room Scheduler Rm2 Rm1 time conflict

29 Meeting Room Scheduler Rm2 Rm1 time No conflict

30 Meeting Room Scheduler Rm2 Rm1 time No conflict

31 Other Resolution Strategies  Classes take priority over meetings  Faculty reservations are bumped by admin reservations  Move meetings to bigger room, if available  Point: -Conflicts are detected at very fine granularity -Resolution can be policy-driven

32 Rolling Back Updates  Keep log of updates  Order by some timestamp  When a new update comes in, place it in the correct order and reapply log of updates  Need to establish when you can truncate the log  Requires old updates to be “committed”, new ones tentative

33 Example of an Undo A will undo update from B, apply C and then B A A:1 A:5 A:10 B B:1 B:5 B:10 C C:1 C:5 C:10

34 Two Basic Issues  Flexible update propagation  Dealing with inconsistencies

35 Flexible Update Propagation Requirements:  Can deal with arbitrary communication topologies  Can deal with low-bandwidth links  Incremental progress (if get disconnected)  Eventual consistency  Flexibile storage management  Can use portable media to deliver updates  Lightweight management of replica sets  Flexible policies (when to reconcile, with whom, etc.)

36 Update Mechanism  Updates timestamped by the receiving server  Writes from a particular server delivered in order  Servers conduct anti-entropy exchanges  State of database is expressed in terms of a timestamp vector  By exchanging vectors, can easily identify which updates are missing

37 Replica Creation/Deletion  Because updates are eventually “committed” you can be sure that certain updates have been spread everywhere  By including replica creation/deletion as a normal “update” you can know which replicas are know to exist by everyone and which are known to be deleted by everyone  Can discard “death certificates” when the deletion update is “committed”

38 Dealing with Inconsistencies  Session guarantees  Conflict detection (update dependencies)  Conflict resolution (already discussed)

39 Session Guarantees  When client move around and connects to different replicas, strange things can happen -Updates you just made are missing -Database goes back in time -Etc.  Design choice: -Insist on stricter consistency -Enforce some “session” guarantees

40 Read Your Writes  Every read in a session should see all previous writes in that session

41 Monotonic Reads and Writes  A later read should never be missing an update present in an earlier read  Same for writes

42 Writes Follow Reads  If a write W followed a read R at a server X, then at all other servers -If W is in Y’s database then any writes relevant to R are also there

43 Supporting Session Guarantees  Responsibility of “session manager”, not servers!  Two sets: -Read-set: set of writes that are relevant to session reads -Write-set: set of writes performed in session  Causal ordering of writes -Use Lamport clocks

44 Update Dependencies  Needed for conflict detection  Captured in write-set, read-sets  But can be more general

45 Next Lecture  Brewer’s conjecture about CAP  Lynch’s proof of the CAP theorem  Something else…..