DOC PREVIEW
CORNELL CS 514 - CS 514 Lecture Notes

This preview shows page 1-2-3-18-19-37-38-39 out of 39 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 39 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS514: Intermediate Course in Operating SystemsQuorum replicationToday’s topicA peek at the conclusionStatic membershipStatic membership exampleQuorumsVersions of replicated dataDoing a read is easyDoing a write is trickierThe sequence of eventsWhich votes got counted?What’s with the [t,pid] stuff?ExampleTimestamps seen by the clients?Where are the updates?Slide 17Slide 18When are updates performed?Slide 20What if “my vote wasn’t used?”Recovery from a crashRead requests received when updates are pending wait…Why is this “safe”?Slide 25What about our rule for votes that didn’t count?Mile high: Why this worksObservationsOur protocol is a 3PC!Risk of blockingPerformance implications?Slide 32So why even consider them?Byzantine QuorumsTypical approach?Costs? Benefits?Virtual synchronyState MachinesTake away?CS514: Intermediate Course in Operating SystemsProfessor Ken BirmanVivek Vishnumurthy: TAQuorum replicationWe developed a whole architecture based on our four-step recipeBut there is a second major approach that also yields a complete group communication framework and solutionsBased on “quorum” read and write operationsOmits notion of process group viewsToday’s topicQuorum methods from a mile highDon’t have time to be equally detailedWe’ll exploreHow the basic read/update protocol worksFailure considerationsState machine replication (a form of lock-step replication for deterministic objects)Performance issuesA peek at the conclusionThese methods areWidely known and closely tied to consensusPerhaps, easier to implementBut they have serious drawbacks:Need deterministic componentsAre drastically slower (10s-100s of events/second)Big win?Recent systems combine quorums with Byzantine Agreement for ultra-sensitive databasesStatic membershipSubsets of a known set of processesE.g. a cluster of five machines, each running replica of a database serverMachines can crash or recover but don’t depart permanently and new ones don’t join “out of the blue”In practice the dynamic membership systems can easily be made to work this way… but usually aren’tStatic membership examplepqrstclientQread = 2, Qwrite = 4read write read Write failsTo do a read, this client (or even a group member) must access at least 2 replicasTo do a write, must update at least 4 replicasThis write will fail: the client only manages to contact 2 replicas and must “abort” the operation (we use this terminology even though we aren’t doing transactions)QuorumsMust satisfy two basic rules1. A quorum read should “intersect” any prior quorum write at >= 1 processes2. A quorum write should also intersect any other quorum writeSo, in a group of size N:1. Qr + Qw > N, and2. Qw + Qw > NVersions of replicated dataReplicated data items have “versions”, and these are numberedI.e. can’t just say “Xp=3”. Instead say that Xp has timestamp [7,q] and value 3Timestamp must increase monotonically and includes a process id to break tiesThis is NOT the pid of the update source… we’ll see where it comes fromDoing a read is easySend RPCs until Qr processes replyThen use the value with the largest timestampBreak ties by looking at the pidFor example[6,x] < [9,a] (first look at the “time”)[7,p] < [7,q] (but use pid as a tie-breaker)Even if a process owns a replica, it can’t just trust it’s own data. Every “read access” must collect Qr values first…Doing a write is trickierFirst, we can’t support incremental updates (x=x+1), since no process can “trust” its own replica.Such updates require a read followed by a write.When we initiate the write, we don’t know if we’ll succeed in updating a quorum of processeswE can’t update just some subset; that could confuse a readerHence need to use a commit protocolMoreover, must implement a mechanism to determine the version number as part of the protocol. We’ll use a form of votingThe sequence of events1. Propose the write: “I would like to set X=3”2. Members “lock” the variable against reads, put the request into a queue of pending writes (must store this on disk or in some form of crash-tolerant memory), and send back:“OK. I propose time [t,pid]”Here, time is a logical clock. Pid is the member’s own pid3. Initiator collects replies, hoping to receive Qw (or more)  Qw OKsCompute maximum of proposed [t,pid] pairs.Commit at that timeAbort< Qw OKsWhich votes got counted?It turns out that we also need to know which votes were “counted”E.g. suppose there are five group members, A…E and they vote:{[17,A] [19,B] [20,C] [200,D] [21,E]}But somehow the vote from D didn’t get through and the maximum is picked as [21,E]We’ll need to also remember that the votes used to make this decision were from {A,B,C,E}What’s with the [t,pid] stuff?Lamport’s suggestion: use logical clocksEach process receives an update messagePlaces it in an ordered queueAnd responds with a proposed time: [t,pid] using its own process id for the timeThe update source takes the maximumCommit message says “commit at [t,pid]”Group members who’s votes were considered deliver committed updates in timestamp orderGroup members who votes were not considered discard the update and don’t do it, at all.One message is lost…ExamplepqrstclientaProposed write…clientbProposed write…B: [0,p]A: [0,s]A: [0,t]… and a third delayed for a long time… another delayed for a little whileB: [1,s]B: [1,t]A: [1,r]A: [1,p]B: [0,r]Timestamps seen by the clients?A sees (in order):[0,p], [0,s], [1,p], [1,r]This is a write quorum (Qw=4)A picks [1,r] from {p,r,s} as the largest “time”B sees[0,r], [0,p], [1,t], [1,s]B picks [1,t] from {p,r,s,t} as the largest time.Note that [1,r] < [1,t], so A goes firstWhere are the updates?Each member has a queue of pending, uncommitted updatesEven if a member crashes and restarts, it remembers this pending queueExample: at process p the queue has{B: [0,p]}; {A: [1,p]}Neither can be delivered (acted upon) since neither time is committed yetRight now, process p can only respond to reads using the old value of the variable!ExamplepqrstclientaProposed write…clientbProposed write…Commit at [1,r]Commit at [1,t] from {p,r,s,t}ExamplepqrstclientaProposed write…clientbProposed write…Commit at [1,r]


View Full Document

CORNELL CS 514 - CS 514 Lecture Notes

Documents in this Course
LECTURE

LECTURE

29 pages

LECTURE

LECTURE

28 pages

Load more
Download CS 514 Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CS 514 Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 514 Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?