Distributed System. Gang Wu. Spring,2018

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

Recovering from a Crash. Three-Phase Commit

Basic vs. Reliable Multicast

Distributed Commit in Asynchronous Systems

Module 8 Fault Tolerance CS655! 8-1!

Today: Fault Tolerance. Reliable One-One Communication

Fault Tolerance. it continues to perform its function in the event of a failure example: a system with redundant components

CS October 2017

CSE 444: Database Internals. Section 9: 2-Phase Commit and Replication

Distributed Systems Consensus

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

Transactions. CS 475, Spring 2018 Concurrent & Distributed Systems

7 Fault Tolerant Distributed Transactions Commit protocols

Distributed Systems. Day 13: Distributed Transaction. To Be or Not to Be Distributed.. Transactions

Goal A Distributed Transaction

Fault Tolerance. o Basic Concepts o Process Resilience o Reliable Client-Server Communication o Reliable Group Communication. o Distributed Commit

CS 425 / ECE 428 Distributed Systems Fall 2017

Today: Fault Tolerance. Fault Tolerance

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 13 - Distribution: transactions

Exam 2 Review. October 29, Paul Krzyzanowski 1

ATOMIC COMMITMENT Or: How to Implement Distributed Transactions in Sharded Databases

Fault Tolerance. Distributed Systems. September 2002

Today: Fault Tolerance

Beyond FLP. Acknowledgement for presentation material. Chapter 8: Distributed Systems Principles and Paradigms: Tanenbaum and Van Steen

ZooKeeper & Curator. CS 475, Spring 2018 Concurrent & Distributed Systems

Fault Tolerance. Chapter 7

Principles of Software Construction: Objects, Design, and Concurrency

Fault Tolerance. Distributed Systems IT332

Module 8 - Fault Tolerance

Today: Fault Tolerance. Replica Management

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5.

Today: Fault Tolerance. Failure Masking by Redundancy

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

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

Distributed Transactions

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

Fault Tolerance. Goals: transparent: mask (i.e., completely recover from) all failures, or predictable: exhibit a well defined failure behavior

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

XI. Transactions CS Computer App in Business: Databases. Lecture Topics

Database Management System

Replication in Distributed Systems

PRIMARY-BACKUP REPLICATION

Paxos Made Live. An Engineering Perspective. Authors: Tushar Chandra, Robert Griesemer, Joshua Redstone. Presented By: Dipendra Kumar Jha

CS 347 Parallel and Distributed Data Processing

Topics in Reliable Distributed Systems

Fault Tolerance. Basic Concepts

Causal Consistency and Two-Phase Commit

Fault Tolerance Causes of failure: process failure machine failure network failure Goals: transparent: mask (i.e., completely recover from) all

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

CSE 5306 Distributed Systems

Paxos provides a highly available, redundant log of events

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

CSE 5306 Distributed Systems. Fault Tolerance

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

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

Proseminar Distributed Systems Summer Semester Paxos algorithm. Stefan Resmerita

Distributed Systems COMP 212. Revision 2 Othon Michail

CS505: Distributed Systems

Primary-Backup Replication

(Pessimistic) Timestamp Ordering. Rules for read and write Operations. Read Operations and Timestamps. Write Operations and Timestamps

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

6.033 Computer System Engineering

Distributed Systems COMP 212. Lecture 19 Othon Michail

Distributed Systems Fault Tolerance

Problem: if one process cannot perform its operation, it cannot notify the. Thus in practise better schemes are needed.

(Pessimistic) Timestamp Ordering

CS 245: Database System Principles

Transactions. Intel (TX memory): Transactional Synchronization Extensions (TSX) 2015 Donald Acton et al. Computer Science W2

Distributed Systems. 19. Fault Tolerance Paul Krzyzanowski. Rutgers University. Fall 2013

Transactions. Transaction. Execution of a user program in a DBMS.

CPS 512 midterm exam #1, 10/7/2016

CSE 444: Database Internals. Lecture 25 Replication

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology

Applications of Paxos Algorithm

MYE017 Distributed Systems. Kostas Magoutis

Distributed Systems 24. Fault Tolerance

Integrity in Distributed Databases

Distributed Systems

Recovery and Logging

EECS 591 DISTRIBUTED SYSTEMS

Coordinating distributed systems part II. Marko Vukolić Distributed Systems and Cloud Computing

Paxos and Distributed Transactions

CS 541 Database Systems. Three Phase Commit

CS 347: Distributed Databases and Transaction Processing Notes07: Reliable Distributed Database Management

Distributed Consensus Protocols

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS

MYE017 Distributed Systems. Kostas Magoutis

Parallel DBs. April 25, 2017

Chapter 4: Distributed Transactions (First Part) IPD, Forschungsbereich Systeme der Informationsverwaltung

416 practice questions (PQs)

Fault Tolerance Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University

Distributed Systems. Characteristics of Distributed Systems. Lecture Notes 1 Basic Concepts. Operating Systems. Anand Tripathi

Distributed Systems. Characteristics of Distributed Systems. Characteristics of Distributed Systems. Goals in Distributed System Designs

Assignment 12: Commit Protocols and Replication Solution

Scale and Scalability Thoughts on Transactional Storage Systems. Liuba Shrira Brandeis University

Consensus in Distributed Systems. Jeff Chase Duke University

The objective. Atomic Commit. The setup. Model. Preserve data consistency for distributed transactions in the presence of failures

CS 347 Parallel and Distributed Data Processing

Recoverability. Kathleen Durant PhD CS3200

Transcription:

Distributed System Gang Wu Spring,2018

Lecture4:Failure& Fault-tolerant Failure is the defining difference between distributed and local programming, so you have to design distributed systems with the expectation of failure "Failure happens all the time. It is your number one concern.

Dependable system Availability Reliability Safety Maintainability

Crash at the Wrong Time Examples Failure during middle of online purchase Failure during mv /home/fudan /home/sjtu Problematic Pay the bill or not? twice? Where and how many files? one / zero / dup? What guarantees do applications need?

Atomicity (All-or-nothing) All-or-nothing Atomicity All-or-nothing A set of operations either all finish or none at all No intermediate state exist upon recovery Transfer $1000 From A: $3000 To B: $2000 A=A-1000, B=B+1000 persistent storage All-or-nothing is one of the guarantees offered by database transactions

Replication Benefits High availability High performance low latency Techniques Organize the replicas (Primary and Backups ) Consistency Failure processing what happens when a primary crashed? Atomicity...

Replication Management Where to place the replicas Servers Replica Content Replica Permanent Copies Cluster (Servers together) Active-Standby work simultaneously (high concurrence) Mirroring Static configuration Server-initialized copies Client-initialized copies

Replication Management Where to place the replicas Servers Replica Content Replica Permanent Copies Server-initialized copies elastic computinig Client-initialized copies client cache

Replication management How to organize the replicas Primary and backups Backups are maintained for availablity only Updates are send to the Primary by the user Eventually consistency Master slaves (coordinator) Master manages the work of slaves computing and data access are doing by the slaves single point of failure Peer to peer

Failure management Primary and backups Backups crash Primary crash elect a new primary Consensus: Allow a group of nodes to agree on a result Paxos: fault-tolerant distributed consensus algorithm (the only known) Master slaves (coordinator) Slaves crash Master crash Peer to peer Heart-beat testing

Failure management Crash recovery Backward recovery Go back to a correct status checkpoint ( Snapshot, Distributed snapshot(message transfer) ) Cost a lot Forward recovery Go forward to a correct status with the help of redundant information Known what failure happened Checkpoint & Logging

Failure management Logging Keep a log of all update actions Each action has 3 required operations old status DO New status New status UNDO Old status Log Log old status REDO New status Log

Distributed transactions How about atomicity and concurrency control in distributed systems? Client desire Atomicity: transfer either happens or not at all Concurrency control: maintain serializability

Distributed transactions Transaction Coordinator (TC) desire Begin transaction Responsible for commit/abort...

Distributed transactions One-phase Commit 1. A does not have enough money 2. Node has crashed 3. Coordinator crashed 4. Some other client is reading/writing A...

Distributed transactions Correctness If one COMMITs, no one ABORTs If one ABORTs, no one COMMITs Two-phase Commit (2PC) The commit-step itself is two phase Phase-1: Voting Each participant prepares to commit, and votes on whether or not it can commit Phase-2: Committing Each participant actually commits or abort

Two-phase Commit (2PC)

Two-phase Commit (2PC) The Voting Phase TC asks each participant? cancommit(t) Participants must prepare to commit using permanent storage before answering Objects are still locked Once a participant votes YES, it is not allowed to cause an ABORT Outcome of T is uncertain until docommit(t) or doabort(t) Other participants might still cause an ABORT

Two-phase Commit (2PC) The Committing Phase TC collects all votes If unanimous YES, cause COMMIT If any participant voted NO, cause ABORT The fate of the T is decided atomically at the TC, once all participants vote TC records fate using permanent storage Then broadcasts docommit(t) or doabort(t) to participants

Two-phase Commit (2PC) INIT Vote-request Vote-abort INIT Commit Vote-request Vote-request Vote-commit Vote-abort Global-abort WAIT Vote-commit Global-commit Global-abort ACK READY Global-commit ACK ABORT COMMIT ABORT COMMIT TC's finite-state machine Participant's finite-state machine

Two-phase Commit (2PC) Timeout TC times out waiting for participant s response Participant times out waiting for TC s outcome message Participant send Vote_abort when timeout at Init TC send Global_aboort to all when timeour at WAIT Participant timeout at READY, check other's status or just blocked Every participants timeout at READY, can only blocked there 3PC