EECS 498 Introduction to Distributed Systems Fall 2017

Slides:



Advertisements
Similar presentations
Megastore: Providing Scalable, Highly Available Storage for Interactive Services. Presented by: Hanan Hamdan Supervised by: Dr. Amer Badarneh 1.
Advertisements

Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
University of Tampere, CS Department Distributed Transaction Management Jyrki Nummenmaa
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
CS 542: Topics in Distributed Systems Diganta Goswami.
Omid Efficient Transaction Management and Incremental Processing for HBase Copyright © 2013 Yahoo! All rights reserved. No reproduction or distribution.
Sanjay Ghemawat, Howard Gobioff and Shun-Tak Leung
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.
Distributed Systems 2006 Styles of Client/Server Computing.
Distributed Systems Fall 2010 Transactions and concurrency control.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Concurrency Control & Caching Consistency Issues and Survey Dingshan He November 18, 2002.
September 24, 2007The 3 rd CSAIL Student Workshop Byzantine Fault Tolerant Cooperative Caching Raluca Ada Popa, James Cowling, Barbara Liskov Summer UROP.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
Distributed Databases
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
Concurrency Control in Distributed Databases. By :- Rishikesh Mandvikar rmandvik[at]engr.smu.edu May 1, 2004.
A New Method for Concurrency Control in Centralized Database Systems Victor T.S. Shi and William Perrizo Computer Science, North Dakota State University.
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.
Distributed Databases DBMS Textbook, Chapter 22, Part II.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Distributed synchronization and mutual exclusion Distributed Transactions.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
CAP Theorem Justin DeBrabant CIS Advanced Systems - Fall 2013.
Antidio Viguria Ann Krueger A Nonblocking Quorum Consensus Protocol for Replicated Data Divyakant Agrawal and Arthur J. Bernstein Paper Presentation: Dependable.
Spanner Storage insights
Lecturer : Dr. Pavle Mogin
CPS 512 midterm exam #1, 10/7/2016 Your name please: ___________________ NetID:___________ /60 /40 /10.
Parallel and Distributed Simulation Techniques
Distributed Transactions and Spanner
Replication Control II Reading: Chapter 15 (relevant parts)
The SNOW Theorem and Latency-Optimal Read-Only Transactions
MVCC and Distributed Txns (Spanner)
Replication and Consistency
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
RELIABILITY.
EECS 498 Introduction to Distributed Systems Fall 2017
Concurrency Control II (OCC, MVCC)
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
Cross-Layer Optimizations between Network and Compute in Online Services Balajee Vamanan.
EECS 498 Introduction to Distributed Systems Fall 2017
Replication and Recovery in Distributed Systems
EEC 688/788 Secure and Dependable Computing
EECS 498 Introduction to Distributed Systems Fall 2017
EECS 498 Introduction to Distributed Systems Fall 2017
EEC 688/788 Secure and Dependable Computing
Lecture 21: Replication Control
Atomic Commit and Concurrency Control
EECS 498 Introduction to Distributed Systems Fall 2017
Concurrency Control II and Distributed Transactions
Causal Consistency and Two-Phase Commit
COS 418: Distributed Systems Lecture 16 Wyatt Lloyd
Database System Architectures
EEC 688/788 Secure and Dependable Computing
Lecture 18: Coherence and Synchronization
Lecture 21: Replication Control
Concurrency control (OCC and MVCC)
Distributed Databases
Presentation transcript:

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

Recap: Two-Phase Locking TC acquires locks on all necessary shards TC commits transaction if locks acquired, else aborts Disjoint transactions can execute concurrently Transactions with overlap run sequentially How to increase concurrency? November 20, 2017 EECS 498 – Lecture 18

Improving Concurrency of Transactions System stores employee  salary mappings T1: TotalSalary = sum of employee salaries T2: MedianSalary = median employee salary Both T1 and T2 require locks for all employees  T1 and T2 must run one after the other But … no conflict if T1 and T2 run concurrently Acquire locks only for data txn will modify? T3: Increase all employee salaries by 10% November 20, 2017 EECS 498 – Lecture 18

Managing Concurrency Two-phase locking is pessimistic Acquire locks assuming conflict will occur Optimistic concurrency control Execute transaction assuming no conflict Verify that no conflict before commit November 20, 2017 EECS 498 – Lecture 18

Optimistic Concurrency Control Read required data and compute results TC ideally reads from local cache Verify that no conflicts TC asks relevant partitions whether safe to commit Commit results Read Phase Validate Phase Write Phase November 20, 2017 EECS 498 – Lecture 18

Centralized Validation TC fetches required data and executes transaction TC sends transaction to validation server Validation server evaluates if commit  conflict If no, ask TC to commit results If yes, ask TC to re-read and re-execute transaction November 20, 2017 EECS 498 – Lecture 18

Validation Unsafe set Safe set T1: Get x=0, Put x=1 T2: Get x=0, Put y=1 T3: Get y=0, Get x=1 T1: Get x=0, Put x=1 T2: Get y=1, Get x=1 T3: Get y=0, Put y=1 If x=0, y=0, and z=0 initially, how to evaluate a set of transactions whether safe to execute concurrently? November 20, 2017 EECS 498 – Lecture 18

Safe Concurrency: Case 1 T1 completes writes before T2 begins read Necessary if T1’s write set overlaps with T2’s read set T1 T2 November 20, 2017 EECS 498 – Lecture 18

Safe Concurrency: Case 2 T1’s write set disjoint from union of T2’s read set and write set Example: T1: TotalSalary = sum of employee salaries T2: MedianSalary = median employee salary T1 T2 November 20, 2017 EECS 498 – Lecture 18

Safe Concurrency: Case 3 T1’s write set disjoint from T2’s read set, and T1 completes write phase before T2’s writes Example? T1: TotalSalary = sum of faculty salaries T2: TotalSalary = sum of graduate student salaries T1 T2 November 20, 2017 EECS 498 – Lecture 18

Distributed Validation TC picks a timestamp based on local clock TC includes timestamp in reads and writes Node invalidates prior reads if transaction with following properties arrives before commit: Lower timestamp Write set of new transaction intersects with read set of old transaction November 20, 2017 EECS 498 – Lecture 18

Distributed Validation TC1 Read P1 Commit P2 Read TC2 November 20, 2017 EECS 498 – Lecture 18

Fault Tolerance of 2PL More shards  Greater chance that one shard unavailable TC Lock Abort P1 P2 P3 November 20, 2017 EECS 498 – Lecture 18

Transaction Latency Impact of multi-partition operations on user-perceived latency: Greater the # of shards that a transaction touches, higher the latency Why? Transaction latency = max(Per-request latency) Transaction slow if response from any one shard is slow November 20, 2017 EECS 498 – Lecture 18

Impact of Tail Latency November 20, 2017 EECS 498 – Lecture 18

November 20, 2017 EECS 498 – Lecture 18

Data from a service at Google Root server receives request from user and executes request at many leaf servers t = 0 Requests issued t = 10ms 50% responses received t = 70ms 95% responses received t = 140ms 100% responses received November 20, 2017 EECS 498 – Lecture 18

Causes for Tail Latency Why might a server be occasionally slow in responding to a request? Infrastructure shared by services Background work Energy management November 20, 2017 EECS 498 – Lecture 18

Solution: Add Redundancy Exploit fact that every server’s state is replicated When sending request to a server, concurrently send requests to replicas Take first response! Problem? Increased load will worsen latencies November 20, 2017 EECS 498 – Lecture 18

Efficient Use of Redundancy Option 1: Issue request first to any one replica Issue requests to other replicas after timeout Increase in load only when first response is slow Tradeoff between timeout and load Option 2: Issue requests to all replicas almost simultaneously Tell every replica to cancel request at other replicas when it responds November 20, 2017 EECS 498 – Lecture 18

Other Solutions for Tail Latency Selectively increase replication for hot partitions Detect and put slow machines on probation Tradeoff quality of response for latency Examples? Google search, Facebook news feed November 20, 2017 EECS 498 – Lecture 18