Rococo: Extract more concurrency from distributed transactions

Slides:



Advertisements
Similar presentations
Wyatt Lloyd * Michael J. Freedman * Michael Kaminsky David G. Andersen * Princeton, Intel Labs, CMU Dont Settle for Eventual : Scalable Causal Consistency.
Advertisements

1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Transaction chains: achieving serializability with low-latency in geo-distributed storage systems Yang Zhang Russell Power Siyuan Zhou Yair Sovran *Marcos.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control Enforcing Serializability by Locks
Phase Reconciliation for Contended In-Memory Transactions Neha Narula, Cody Cutler, Eddie Kohler, Robert Morris MIT CSAIL and Harvard 1.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Concurrency Control Chapter 17 Sections
Lecture 12 Transactions: Isolation. Transactions What’s hard? – ACID – Concurrency control – Recovery.
CSIS 7102 Spring 2004 Lecture 5 : Non-locking based concurrency control (and some more lock-based ones, too) Dr. King-Ip Lin.
Author: Yang Zhang[SOSP’ 13] Presentator: Jianxiong Gao.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
1 Database Replication Using Generalized Snapshot Isolation Sameh Elnikety, EPFL Fernando Pedone, USI Willy Zwaenepoel, EPFL.
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
Distributed Systems 2006 Styles of Client/Server Computing.
Concurrency Control R&G - Chapter 17 Smile, it is the key that fits the lock of everybody's heart. Anthony J. D'Angelo, The College Blue Book.
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
CS 582 / CMPE 481 Distributed Systems
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Persistent State Service 1 Distributed Object Transactions  Transaction principles  Concurrency control  The two-phase commit protocol  Services for.
1 ICS 214B: Transaction Processing and Distributed Data Management Replication Techniques.
Session - 13 CONCURRENCY CONTROL CONCURRENCY TECHNIQUE Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Transaction Processing: Concurrency and Serializability 10/4/05.
Transaction Management
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Concurrency Control. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Transaction Processing.
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
AN OPTIMISTIC CONCURRENCY CONTROL ALGORITHM FOR MOBILE AD-HOC NETWORK DATABASES Brendan Walker.
Concurrency Control in Distributed Databases. By :- Rishikesh Mandvikar rmandvik[at]engr.smu.edu May 1, 2004.
Concurrency control in transactional systems Jinyang Li Some slides adapted from Stonebraker and Madden.
Presented by Dr. Greg Speegle April 12,  Two-phase commit slow relative to local transaction processing  CAP Theorem  Option 1: Reduce availability.
Security and Transaction Nhi Tran CS 157B - Dr. Lee Fall, 2003.
Distributed Transactions
Overview – Chapter 11 SQL 710 Overview of Replication
Chapter 11 Concurrency Control. Lock-Based Protocols  A lock is a mechanism to control concurrent access to a data item  Data items can be locked in.
11/7/2012ISC329 Isabelle Bichindaritz1 Transaction Management & Concurrency Control.
Eiger: Stronger Semantics for Low-Latency Geo-Replicated Storage Wyatt Lloyd * Michael J. Freedman * Michael Kaminsky † David G. Andersen ‡ * Princeton,
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.
A Survey on Optimistic Concurrency Control CAI Yibo ZHENG Xin
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Concurrency Control and Reliable Commit Protocol in Distributed Database Systems Jian Jia Chen 2002/05/09 Real-time and Embedded System Lab., CSIE, National.
Page 1 Concurrency Control Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
6.830 Lecture 14 Two-phase Locking Recap Optimistic Concurrency Control 10/28/2015.
NOEA/IT - FEN: Databases/Transactions1 Transactions ACID Concurrency Control.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
3 Database Systems: Design, Implementation, and Management CHAPTER 9 Transaction Management and Concurrency Control.
Database Isolation Levels. Reading Database Isolation Levels, lecture notes by Dr. A. Fekete, resentation/AustralianComputer.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Distributed Transactions What is a transaction? (A sequence of server operations that must be carried out atomically ) ACID properties - what are these.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Last Class: Canonical Problems
Shuai Mu, Lamont Nelson, Wyatt Lloyd, Jinyang Li
a journey from the simple to the optimal
The SNOW Theorem and Latency-Optimal Read-Only Transactions
Concurrency control in transactional systems
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
Distributed Transactions
Concurrency Control II (OCC, MVCC)
Chapter 10 Transaction Management and Concurrency Control
Distributed Transactions
Atomic Commit and Concurrency Control
The SNOW Theorem and Latency-Optimal Read-Only Transactions
Concurrency control (OCC and MVCC)
Presentation transcript:

Rococo: Extract more concurrency from distributed transactions Shuai Mu, Yang Cui, Yang Zhang, Wyatt Lloyd, Jinyang Li Tsinghua University, New York University, University of Southern California, Facebook

What Large Web Sites Need 170 million sold/day 36.8 million sold/day $169 billion trade/day Scalable Storage w/ Transactions! ……

What is a Distributed Transaction? BEGIN_TX if (iphone > 0) { iphone--; } if (case > 0) { case--; END_TX Item Stock iPhone 6 Plus 1 iPhone Case if (iphone > 0) { iphone--; } if (case > 0) { case--; } iPhone=1 Case=1 Transactions should be strictly serializable! Otherwise…

Loss of serializability = angry customer

Serializability is Costly under Contention

OCC Aborts Contended Transactions if (iphone > 0) { iphone--; } if (case > 0) { case--; if (iphone > 0) { iphone--; } if (case > 0) { case--; Two-Phase Commit (2PC) Execute If (iphone > 0) { iphone--; } if (case > 0) { case--; } iPhone=1 Case=1 If (iphone > 0) { iphone--; } if (case > 0) { case--; }

2PL Blocks Contended Transactions if (iphone > 0) { iphone--; } if (case > 0) { case--; if (iphone > 0) { iphone--; } if (case > 0) { case--; 2PC Execute If (iphone > 0) { iphone--; } if (case > 0) { case--; } iPhone=1 Case=1 If (iphone > 0) { iphone--; } if (case > 0) { case--; }

Achieve serializability w/o aborting or blocking* * for common workloads

Defer piece execution to enable reordering Rococo’s Approach if (iphone > 0) { iphone--; } if (case > 0) { case--; if (iphone > 0) { iphone--; } if (case > 0) { case--; If (iphone > 0) { iphone--; } if (case > 0) { case--; } iPhone=1 Case=1 If (iphone > 0) { iphone--; } if (case > 0) { case--; } Defer piece execution to enable reordering

Rococo Overview: Key techniques Enable piece reordering for serializability Two-phase protocol Most pieces are executed at the second (commit) phase Decentralized dependency tracking Servers track pieces’ arrival order Identify non-serializable orders Deterministically reorder pieces Offline workload checking Identifies safe workloads (common) Identifies small parts that need traditional approaches (rare) Avoid aborts for common workloads

#1 Two-phase protocol Start Phase Commit Phase Send pieces to servers w/o executing them Establish a final order and execute pieces Set up a provisional order Reorder for serializability

#2 Dependency Tracking: Start Phase if ...iphone-- if ... iphone-- if ... case-- T1 T2 if ... case-- dep dep if ... iphone-- T1 if ... case-- T2 if ... iphone-- if ... case-- T2 T1 iPhone=1 Case=1

#2 Dependency Tracking: Commit Phase Sort the cycle by any deterministic order T1 T2 T1 T2 dep dep if ... iphone-- if ... case-- T2 T1 T2 T1 T2 T1 if ... iphone-- if ... case-- T2 T1 iPhone=1 Case=1

Problem: Not Every Piece is Deferrable oid = next_oid ++ if ... iphone-- if ... case-- orderline.insert(oid, …) Intermediate Results Calls for Immediate Execution next_oid iPhone Case orderline orderline.insert( oid, ……) oid = next_oid ++ if ... iphone-- if ... case-- oid

Immediate Pieces are Naughty! a = next_a++; b = next_b++; ol_a.insert(a, …); ol_b.insert(b, …); a = next_a++; b = next_b++; ol_a.insert(a, …); ol_b.insert(b, …); next_a = 0 next_b = 0 a = next_a++ b = next_b ++ a = next_a++ b = next_b ++ 1. Common workloads have few immediate pieces 2. Pre-known workload  Offline check

#3: Offline Checking: Basic S(ibling)-edge linking pieces within a transaction T1 T2 Item_Table T1 T2 iphone case C(onflict)-edge linking pieces w/ conflicting access An SC-cycle consists of both S-edge and C-edge SC-cycles represent potential non-serializable executions that require 2PL/OCC

#3: Offline Checking: Enhanced OidTable ItemTable ItemTable T1 Immediate Deferrable OidTable ItemTable ItemTable T2 SC-cycles with deferrable pieces can be safely reordered!

Incorporating Immediate Pieces oid oid Every cycle contains deferrable pieces, ensured by offline checking A cycle with deferrable pieces is safe to reorder iphone iphone case case orderline orderline oid iphone case orderline oid iphone case orderline dep dep dep dep T2 T1 T1 T2 T2 T1 T1 T2 Immediate dependency Deferrable dependency orderline next_oid iPhone Case 18

Decentralized Dependency Tracking Deferred Execution Decentralized Dependency Tracking Offline Checking Merged Pieces Read-only Transactions Reducing Dep. Size Fault Tolerance Overlapping Trans. ……

Evaluation How does Rococo perform under contention? How does Rococo scale?

Workload: Scaled TPC-C One warehouse, many districts Partitioned by districts - all transactions distributed 5~15 New order (45%) Payment (43%) Delivery (4%) Read-only: OrderStatus(4%), StockLevel (4%)

Rococo Has Higher Throughput Increasing graph size Aborts due to deadlock detection Aborts due to conflicts in validation 8 servers, 10 districts per server  Main source of contention is next_oid of each district

Rococo Avoids Aborts 61~66ms 152~392ms 173~645ms

10 districts per server, fixed # of items  contention grows slowly Rococo Scales Out Almost Linear Blocking Aborts 10 districts per server, fixed # of items  contention grows slowly

Related Work Decentralized dependency tracking Isolation Level Concurrency Control Mech. Rococo Strict-Serial. Calvin [SIGMOD’12] Strict-Serial. Pre-ordered Locking Spanner [OSDI’12] Strict-Serial. 2PL HStore [VLDB’07] OCC Centralized sequencing layer, difficult to scale Lynx [SOSP’13] Serial. Origin Ordering Granola [SIGMOD’10] Timestamp based Percolator [OSDI’10] S.I. OCC Walter [SOSP’11] P.S.I. W-W Preclusion COPS [SOSP’11] Causal Dependency Tracking

Conclusion Traditional protocols perform poorly w/ contention OCC aborts & 2PL blocks Rococo defers execution to enable reordering Strict serializability w/o aborting or blocking for common workloads Rococo outperforms 2PL & OCC With growing contention Scales out

Questions? Thank you! https://github.com/msmummy/rococo Poster tonight!