CS State Machine Replication

Similar documents
Fault Tolerance via the State Machine Replication Approach. Favian Contreras

Atomicity. Bailu Ding. Oct 18, Bailu Ding Atomicity Oct 18, / 38

Practical Byzantine Fault Tolerance. Castro and Liskov SOSP 99

Replication in Distributed Systems

Basic vs. Reliable Multicast

Failure models. Byzantine Fault Tolerance. What can go wrong? Paxos is fail-stop tolerant. BFT model. BFT replication 5/25/18

Today. A methodology for making fault-tolerant distributed systems.

Distributed Systems (ICE 601) Fault Tolerance

Distributed Systems. replication Johan Montelius ID2201. Distributed Systems ID2201

Distributed Systems COMP 212. Lecture 19 Othon Michail

Today: Fault Tolerance

Fault Tolerance. Distributed Software Systems. Definitions

Recovering from a Crash. Three-Phase Commit

Fault Tolerance. Basic Concepts

Transactions Between Distributed Ledgers

Today: Fault Tolerance. Fault Tolerance

Failures, Elections, and Raft

Robust BFT Protocols

Coordination 1. To do. Mutual exclusion Election algorithms Next time: Global state. q q q

Consensus in Distributed Systems. Jeff Chase Duke University

Parallel Data Types of Parallelism Replication (Multiple copies of the same data) Better throughput for read-only computations Data safety Partitionin

Today: Fault Tolerance. Replica Management

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

Causal Consistency and Two-Phase Commit

Proseminar Distributed Systems Summer Semester Paxos algorithm. Stefan Resmerita

Recap. CSE 486/586 Distributed Systems Paxos. Paxos. Brief History. Brief History. Brief History C 1

Fault Tolerance. Distributed Systems. September 2002

Today: Fault Tolerance. Failure Masking by Redundancy

Dep. Systems Requirements

Byzantine Fault Tolerance and Consensus. Adi Seredinschi Distributed Programming Laboratory

Distributed Systems 11. Consensus. Paul Krzyzanowski

Practical Byzantine Fault

Distributed Systems COMP 212. Revision 2 Othon Michail

There Is More Consensus in Egalitarian Parliaments

CSE 5306 Distributed Systems. Fault Tolerance

CS 138: Practical Byzantine Consensus. CS 138 XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Replications and Consensus

Distributed Algorithms Reliable Broadcast

Consensus Problem. Pradipta De

Consensus and related problems

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

Distributed Systems Consensus

Viewstamped Replication to Practical Byzantine Fault Tolerance. Pradipta De

CS 425 / ECE 428 Distributed Systems Fall 2017

CSE 5306 Distributed Systems

Basic concepts in fault tolerance Masking failure by redundancy Process resilience Reliable communication. Distributed commit.

Data Consistency and Blockchain. Bei Chun Zhou (BlockChainZ)

Distributed Systems. 09. State Machine Replication & Virtual Synchrony. Paul Krzyzanowski. Rutgers University. Fall Paul Krzyzanowski

Introduction to Distributed Systems Seif Haridi

CS5412: CONSENSUS AND THE FLP IMPOSSIBILITY RESULT

Failure Tolerance. Distributed Systems Santa Clara University

BYZANTINE GENERALS BYZANTINE GENERALS (1) A fable: Michał Szychowiak, 2002 Dependability of Distributed Systems (Byzantine agreement)

Fault Tolerance. Distributed Systems IT332

To do. Consensus and related problems. q Failure. q Raft

Byzantine Techniques

Paxos and Raft (Lecture 21, cs262a) Ion Stoica, UC Berkeley November 7, 2016

Consensus, impossibility results and Paxos. Ken Birman

Transactions. CS 475, Spring 2018 Concurrent & Distributed Systems

CS 43: Computer Networks. 08:Network Services and Distributed Systems 19 September

Byzantine Failures. Nikola Knezevic. knl

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson

Consensus a classic problem. Consensus, impossibility results and Paxos. Distributed Consensus. Asynchronous networks.

Security (and finale) Dan Ports, CSEP 552

Paxos provides a highly available, redundant log of events

Recall: Primary-Backup. State machine replication. Extend PB for high availability. Consensus 2. Mechanism: Replicate and separate servers

Coordination 2. Today. How can processes agree on an action or a value? l Group communication l Basic, reliable and l ordered multicast

System Models for Distributed Systems

System models for distributed systems

Capacity of Byzantine Agreement: Complete Characterization of Four-Node Networks

Global atomicity. Such distributed atomicity is called global atomicity A protocol designed to enforce global atomicity is called commit protocol

Distributed Systems COMP 212. Lecture 17 Othon Michail

Key-value store with eventual consistency without trusting individual nodes

Linearizability CMPT 401. Sequential Consistency. Passive Replication

Discussion of Failure Mode Assumptions for IEEE 802.1Qbt

Process groups and message ordering

Self-Stabilizing Byzantine Digital Clock Synchronization

Consistency in Distributed Systems

Distributed Algorithms (PhD course) Consensus SARDAR MUHAMMAD SULAMAN

A definition. Byzantine Generals Problem. Synchronous, Byzantine world

Chapter 5: Distributed Systems: Fault Tolerance. Fall 2013 Jussi Kangasharju

Byzantine Fault Tolerance

CSE 124: REPLICATED STATE MACHINES. George Porter November 8 and 10, 2017

G Bayou: A Weakly Connected Replicated Storage System. Robert Grimm New York University

Failure Models. Fault Tolerance. Failure Masking by Redundancy. Agreement in Faulty Systems

CSE 5306 Distributed Systems. Consistency and Replication

Agreement and Consensus. SWE 622, Spring 2017 Distributed Software Engineering

Practical Byzantine Fault Tolerance

Reducing the Costs of Large-Scale BFT Replication

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

Silberschatz and Galvin Chapter 18

CS 470 Spring Fault Tolerance. Mike Lam, Professor. Content taken from the following:

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication

Distributed Systems (5DV147)

Distributed Systems. Multicast and Agreement

Byzantine fault tolerance. Jinyang Li With PBFT slides from Liskov

Practical Byzantine Fault Tolerance (The Byzantine Generals Problem)

Distributed Systems. Fault Tolerance. Paul Krzyzanowski

Recall our 2PC commit problem. Recall our 2PC commit problem. Doing failover correctly isn t easy. Consensus I. FLP Impossibility, Paxos

FAULT TOLERANCE. Fault Tolerant Systems. Faults Faults (cont d)

EECS 498 Introduction to Distributed Systems

Transcription:

CS 5450 State Machine Replication

Key Ideas To tolerate faults replicate functionality! Can represent deterministic distributed system as replicated state machine (SMR) Each replica reaches the same conclusion about the system independently Key examples of distributed algorithms that generically implement SMR Formalizes notions of fault-tolerance in SMR slide 2

Motivation Server Client 10 get(x) get(x) No response Client

Motivation Server Client

Motivation uneed replication for fault tolerance uwhat happens in these scenarios without replication? Storage - disk failure Web service - network failure ube able to reason about failure tolerance uhow badly can things go wrong and have our system continue to function? slide 5

State Machines ustate variables udeterministic commands slide 6

Requests and Causality Process order consistent with potential causality uclient A sends r, then r' ur is processed before r' ur causes Client B to send r' ur is processed before r'. slide 7

Coding State Machines ustate machines are procedures uclient calls procedure uavoid loops umore flexible structure slide 8

State Machine Replication c X = Y X = Y X = Y X = Y State Machine Replica

State Machine Replication f(c) f(c) X = Z X = Z f(c) f(c) X = Z X = Z State Machine Replica

Write put(x,10)

After the Write Great!

Write put(x,10)

Need Agreement get(x) 10 get(x) Replicas need to agree which requests have been handled 3 Problem!

Two Writes put(x,10) put(x,30)

Either Outcome is Fine 0 0 OR 0 0

Order Matters put(x,10) put(x,30)

Order Matters put(x,10) put(x,30)

Order Matters put(x,10) put(x,30) 0 0

Order Matters put(x,10) put(x,30) 0 0

Order Matters 0 0 Replicas need to handle requests in the same order

Requirements All non-faulty servers need uagreement Every replica needs to accept the same set of requests uorder All replicas process requests in the same relative order slide 22

Idea for Agreement usomeone proposes a request uif the proposer is non-faulty, all servers will accept that request slide 23

Agreement put(x,10)

Agreement put(x,10) Non-faulty Transmitter

Idea for Order Assign unique ids to requests, process them in ascending order uhow do we assign unique ids in a distributed system? uhow do we know when every replica has processed a given request? slide 26

Order put(x,30) put(x,10)

Order put(x,30) put(x,10) Assign Total Ordering Request ID 1 2

Order Assign Total Ordering Request ID 1 2

Order Assign Total Ordering Request ID 1 2

Order 0 0 0 0 Assign Total Ordering Request ID 1 2 Cannot receive request with smaller ID is now stable!

Order Assign Total Ordering Request ID 1 2 is now stable! is now stable!

Generating IDs uorder via clocks (client timestamp = id) Logical clocks Synchronized clocks utwo-phase ID generation Every replica proposes a candidate One candidate is chosen and agreed upon by all replicas slide 33

Replica ID Generation put(x,30) put(x,10)

Replica ID Generation 1.1 1.3 2.1 2.3 1.2 1.4 2.2 2.4 1) Propose candidates

Replica ID Generation 1.1 2.4 1.3 2.1 2.3 2.4 1.2 2.4 1.4 2.2 2.4 2.4 2) Accept

Replica ID Generation 1.1 2.4 1.3 2.2 2.1 2.2 2.3 2.4 1.2 2.4 1.4 2.2 2.2 2.2 2.4 2.4 3) Accept

Replica ID Generation 2.1 2.2 1.3 2.2 1.1 2.4 2.3 2.4 2.2 2.2 1.4 2.2 1.2 2.4 2.4 2.4 is now stable

Replica ID Generation 2.1 2.2 1.3 2.2 1.1 2.4 2.3 2.4 2.2 2.2 1.4 2.2 1.2 2.4 2.4 2.4 4) Apply

Replica ID Generation 2.1 2.2 0 0 1.3 2.2 1.1 2.4 2.3 2.4 2.2 2.2 0 0 1.4 2.2 1.2 2.4 2.4 2.4 5) Apply

Rules for Replica-Generated IDs uany new candidate ID must be > ID of any accepted request uthe ID selected from the candidate list must be >= each candidate uwhen is a candidate stable? It has been accepted No other pending request with a smaller candidate ID slide 41

Faults ufail-stop A faulty server can be detected as faulty ubyzantine Faulty servers can do arbitrary, perhaps malicious things This includes crash failures (server can stop responding without notification) slide 42

Fail-Stop Tolerance put(x,30)

Fail-Stop Tolerance 1.1 1) Propose Candidates.

Fail-Stop Tolerance 1.1 1.1 2) Accept

Fail-Stop Tolerance 1.1 1.1 0 2) Apply

Fail-Stop Tolerance 0 GAME OVER!!! 2) Apply

Fail-Stop Fault Tolerance uto tolerate t failures, need t+1 servers. uas long as 1 server remains, we re OK uonly need to participate in protocols with other live servers slide 48

Byzantine Fault Tolerance uto tolerate t failures, need 2t + 1 servers uprotocols now involve votes Can only trust server response if the majority of servers say the same thing ut + 1 servers need to participate in replication protocols slide 64

Lamport (1978) slide 65

Fault-Tolerant State Machines uimplement the state machine on multiple processors ustate machine replication Each starts in the same initial state Executes the same requests Requires consensus to execute in same order Deterministic, each will do the exact same thing Produce the same output slide 66

Consensus utermination uvalidity uintegrity uagreement Ensures procedures are called in same order across all machines slide 67