EECS 498 Introduction to Distributed Systems Fall 2017

Slides:



Advertisements
Similar presentations
Two phase commit. Failures in a distributed system Consistency requires agreement among multiple servers –Is transaction X committed? –Have all servers.
Advertisements

1 Lecture 11: Transactions: Concurrency. 2 Overview Transactions Concurrency Control Locking Transactions in SQL.
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Failure Detection The ping-ack failure detector in a synchronous system satisfies – A: completeness – B: accuracy – C: neither – D: both.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Two phase commit. What we’ve learnt so far Sequential consistency –All nodes agree on a total order of ops on a single object Crash recovery –An operation.
Persistent State Service 1 Distributed Object Transactions  Transaction principles  Concurrency control  The two-phase commit protocol  Services for.
Transaction Processing: Concurrency and Serializability 10/4/05.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 18: Replication Control All slides © IG.
Distributed Databases
CIS 720 Concurrency Control. Locking Atomic statement –Can be used to perform two or more updates atomically Th1: …. ;……. Th2:…………. ;…….
CS162 Section Lecture 10 Slides based from Lecture and
08_Transactions_LECTURE2 DBMSs should guarantee ACID properties (Atomicity, Consistency, Isolation, Durability). This is typically done by guaranteeing.
Transactions and Concurrency Control Distribuerade Informationssystem, 1DT060, HT 2013 Adapted from, Copyright, Frederik Hermans.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Distributed synchronization and mutual exclusion Distributed Transactions.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Commit Algorithms Hamid Al-Hamadi CS 5204 November 17, 2009.
Chapter 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
EEC 688/788 Secure and Dependable Computing Lecture 9 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Distributed Transactions What is a transaction? (A sequence of server operations that must be carried out atomically ) ACID properties - what are these.
Transactions.
a journey from the simple to the optimal
Spanner Storage insights
CSE 486/586 Distributed Systems Consistency --- 1
CPS 512 midterm exam #1, 10/7/2016 Your name please: ___________________ NetID:___________ /60 /40 /10.
Concurrency control in transactional systems
Two phase commit.
Distributed Transactions and Spanner
The SNOW Theorem and Latency-Optimal Read-Only Transactions
COS 418: Advanced Computer Systems Lecture 5 Michael Freedman
EECS 498 Introduction to Distributed Systems Fall 2017
MVCC and Distributed Txns (Spanner)
IS 651: Distributed Systems Consensus
Concurrency Control II (OCC, MVCC) and Distributed Transactions
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
CSE 486/586 Distributed Systems Consistency --- 1
EECS 498 Introduction to Distributed Systems Fall 2017
Lecture 21: Concurrency & Locking
CS162 Operating Systems and Systems Programming Review (II)
EEC 688/788 Secure and Dependable Computing
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
From Viewstamped Replication to BFT
EEC 688/788 Secure and Dependable Computing
Distributed Transactions
Lecture 21: Replication Control
Atomic Commit and Concurrency Control
EECS 498 Introduction to Distributed Systems Fall 2017
Concurrency Control II and Distributed Transactions
IS 651: Distributed Systems Final Exam
Causal Consistency and Two-Phase Commit
Decoupled Storage: “Free the Replicas!”
COS 418: Distributed Systems Lecture 16 Wyatt Lloyd
Transaction Management
EEC 688/788 Secure and Dependable Computing
UNIVERSITAS GUNADARMA
EEC 688/788 Secure and Dependable Computing
Lecture 21: Replication Control
Concurrent, Consistent Applications over a Distributed Shared Log
Concurrency control (OCC and MVCC)
Presentation transcript:

EECS 498 Introduction to Distributed Systems Fall 2017 Harsha V. Madhyastha

Project 3 and Guest Lecture Think about throughput optimizations in P3 Every KVPaxos server handles one Op at a time Every request requires at least two round trips of communication to be committed Useful exam prep! Example optimizations? Use leader (fault-tolerance? distant leader?) Quorum reads Use last write seen at quorum of acceptors Concurrent writes? November 15, 2017 EECS 498 – Lecture 17

Distributed Transactions Partitioning of state necessary to scale Partitioning results in the need for transactions Atomically execute operations across shards Examples: Add meeting to calendars of two participants Transfer money from one account to another Looking up balance of two accounts November 15, 2017 EECS 498 – Lecture 17

Concurrency + Serializability Execution of transactions: Externally visible effects: T1 T2 T3 T2 T1 T3 November 15, 2017 EECS 498 – Lecture 17

Example of Serializability Concurrent execution of transactions: T1: Transfer $10 from Alice to Bob T2: Read balance in Alice’s and Bob’s accounts Initial balance of $100 in both accounts Permissible outputs for T2: (Alice: $100, Bob: $100) or (Alice: $90, Bob: $110) Invalid outputs for T2: (Alice: $90, Bob: $100) or (Alice: $100: Bob: $110) November 15, 2017 EECS 498 – Lecture 17

Achieving Serializability When is concurrent execution of transactions safe? Data read/written is disjoint When must two transactions execute in order? Intersection in data read/written Solution for serializability: Fine-grained locks Transaction coordinator first acquires locks for all data Execute transaction and release locks November 15, 2017 EECS 498 – Lecture 17

Two Phase Locking TC P1 P2 P3 Lock Abort November 15, 2017 EECS 498 – Lecture 17

Two Phase Locking Can we reduce latency for read-only transactions? TC Commit P1 P2 P3 Return data in first round if lock not held November 15, 2017 EECS 498 – Lecture 17

Optimizing Read-Only Txns Concurrent execution of transactions: T1: Transfer $10 from Alice to Bob T2: Read balance in Alice’s and Bob’s accounts Initial balance of $100 in both accounts Problematic sequence of concurrent execution? TC2 reads Alice’s account balance as $100 TC1 executes 2PL to acquire locks on both accounts, transfer $100, and release locks TC2 reads Bob’s account balance as $110 November 15, 2017 EECS 498 – Lecture 17

Lock-free Read-Only Txns TC1 Read P1 P2 Lock Commit TC2 November 15, 2017 EECS 498 – Lecture 17

Fault Tolerance of 2PL TC1 P1 P2 TC2 Lock Commit Lock Commit November 15, 2017 EECS 498 – Lecture 17

Fault Tolerance of 2PL Okay to commit after timeout? TC P1 P2 P3 Lock November 15, 2017 EECS 498 – Lecture 17

Fault Tolerance of 2PL TC P1 P2 P3 Lock Abort November 15, 2017 EECS 498 – Lecture 17

Fault Tolerance of 2PL TC P1 P2 P3 Lock Commit P1 P2 P3 When can we garbage collect transaction log? November 15, 2017 EECS 498 – Lecture 17

Garbage Collection Lock acquisition in node log: Node receives commit from TC and writes to its log Commit operation in TC log: After all nodes say transaction committed Commit operation in node log: Upon applying operation to local state November 15, 2017 EECS 498 – Lecture 17

Fault Tolerance Transaction cannot succeed if any partition unavailable TC Lock Abort P1 P2 P3 Every partition should be implemented as an RSM November 15, 2017 EECS 498 – Lecture 17

Fault Tolerance Client RSM to offer high availability, but equivalent to single server Partition RSM state in order to scale Implement each partition as an RSM to improve availability of cross-partition transactions November 15, 2017 EECS 498 – Lecture 17