Elastic Transactions Pascal Felber Vincent Gramoli Rachid Guerraoui.

Slides:



Advertisements
Similar presentations
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Advertisements

Enabling Speculative Parallelization via Merge Semantics in STMs Kaushik Ravichandran Santosh Pande College.
Sathya Peri IIT Patna 1 Understanding the Requirements of STMs.
CS6223: Distributed Systems
Transactions (Chapter ). What is it? Transaction - a logical unit of database processing Motivation - want consistent change of state in data Transactions.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Transaction Processing on Top of Hadoop Spring 2012 Aviram Rehana Lior Zeno Supervisor : Edward Bortnikov.
Parallel Inclusion-based Points-to Analysis Mario Méndez-Lojo Augustine Mathew Keshav Pingali The University of Texas at Austin (USA) 1.
Prepared by: Mudra Patel (113) Locking Scheduler & Managing Hierarchies of Database Elements.
Submitted by: Omer & Ofer Kiselov Supevised by: Dmitri Perelman Networked Software Systems Lab Department of Electrical Engineering, Technion.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Two Ways of Speeding Up Transactional Memory Algorithms Vincent Gramoli Joint work with Pascal Felber, Rachid Guerraoui, Derin Harmanci.
By Sarita Adve & Kourosh Gharachorloo Review by Jim Larson Shared Memory Consistency Models: A Tutorial.
Transaction Processing: September 27, Database Access For TP, represent database as a collection of named items. Read(X) - read database item X.
EPFL - March 7th, 2008 Interfacing Software Transactional Memory Simplicity vs. Flexibility Vincent Gramoli.
Elastic Transactions Unleashing Concurrency of Transactional Memory Pascal Felber Vincent Gramoli Rachid Guerraoui.
TM Input Acceptance Vincent Gramoli, Derin Harmanci, Pascal Felber EPFL LPD - University of Neuchâtel Switzerland.
1 ACID Properties of Transactions Chapter Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 2 Chapter 2 Model for transactions.
The Cost of Privatization Hagit Attiya Eshcar Hillel Technion & EPFLTechnion.
1 Introduction to Transaction Processing (1)
Concurrency Control John Ortiz.
Transaction Processing
Concurrency Control Chapter 18 Section 18.5 Presented by Khadke, Suvarna CS 257 (Section II) Id
Desirable features implementation How to cope with multiple users conducting simultaneous transactions.
1 Chapter 18 ACID Properties of Transactions. 2 Transactions Many enterprises use databases to store information about their state –e.g., Balances of.
Transactions March 14, Transactions What is a transaction?  A set of operations that must behave as a single operation  e.g., { read account.
1 Transaction Management Overview Chapter Transactions  Concurrent execution of user programs is essential for good DBMS performance.  Because.
1 Transactions BUAD/American University Transactions.
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
Reduced Hardware NOrec: A Safe and Scalable Hybrid Transactional Memory Alexander Matveev Nir Shavit MIT.
Querying Large Databases Rukmini Kaushik. Purpose Research for efficient algorithms and software architectures of query engines.
Introduction to Data Management CSE 344 Lecture 23: Transactions CSE Winter
1 Performance Tuning Next, we focus on lock-based concurrency control, and look at optimising lock contention. The key is to combine the theory of concurrency.
WG5: Applications & Performance Evaluation Pascal Felber
“Enthusiasm releases the drive to carry you over obstacles and adds significance to all you do.” – Norman Vincent Peale Thought for the Day.
Transactions. What is it? Transaction - a logical unit of database processing Motivation - want consistent change of state in data Transactions developed.
Lecture 13 Advanced Transaction Models. 2 Protocols considered so far are suitable for types of transactions that arise in traditional business applications,
Midterm 3 Revision Professor Sin-Min Lee Department of Computer Science.
Transactional Coherence and Consistency Presenters: Muhammad Mohsin Butt. (g ) Coe-502 paper presentation 2.
Fence Complexity in Concurrent Algorithms Petr Kuznetsov TU Berlin/DT-Labs.
CS533 Concepts of Operating Systems Jonathan Walpole.
Fan Qi Database Lab 1, com1 #01-08 CS3223 Tutorial 9.
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
EFFICIENT SOLUTION TO REPLICATED LOG AND DICTIONARY PROBLEM. (Gene T.J. Wuu & Arthur J. Bernstein.) Presented By : Megha Priyanka.
1 Controlled concurrency Now we start looking at what kind of concurrency we should allow We first look at uncontrolled concurrency and see what happens.
Transaction Management Exercises I/O and CPU activities can be and are overlapped to minimize (disk and processor) idle time and to maximize throughput.
Database Isolation Levels. Reading Database Isolation Levels, lecture notes by Dr. A. Fekete, resentation/AustralianComputer.
1 Introduction to Transaction Processing (1)
Faster Data Structures in Transactional Memory using Three Paths
CS216: Data-Intensive Computing Systems
Concurrency Control.
Assignment 2 - Solution   1. w0[x,y,z] c0 r1[x] r2[y] w2[y] r3[z] w3[z] r2[z] w2[y] w1[z] w1[y] c1 c2 c3 a. An equivalent serial history must preserve.
March 21st – Transactions
Trafodion Distributed Transaction Management
CIS 720 Concurrency Control.
Distributed DBMS Model
Distributed Transactions
Lecture 6: Transactions
Chapter 15 : Concurrency Control
Exercises for Chapter 16: Distributed Shared Memory
Ranjeet Kumar K. Vidyasankar Memorial University St. John’s CANADA
Distributed Database Management Systems
Distributed Database Management Systems
Dynamic Performance Tuning of Word-Based Software Transactional Memory
Controlled Interleaving for Transactions
Lecture 18: Concurrency Control
Outline Introduction Background Distributed DBMS Architecture
Transaction Serializability
Presentation transcript:

Elastic Transactions Pascal Felber Vincent Gramoli Rachid Guerraoui

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x)

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x)

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z Both transactions DO NOT commit…

Regular Transactions Set implementation w/ sorted linked list (x < y < z) y y t t h h BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) x x z z None of these accesses depend on the execution of the other None of these accesses depend on the execution of the other …but both transactions COULD commit.

Large Data Structures Linked list Integer set 2 16 elements in avg.

Large Data Structures Linked list Integer set 2 16 elements in avg. 8-core Intel Xeon 1 operation / tx TinySTM (most efficient on μ-benchs AFAWK)

Static Cut Set implementation w/ sorted linked list

Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x)

Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) Cut here

Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX

Static Cut Set implementation w/ sorted linked list BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX Lost update issue [Valois 95]

Elastic Transactions An elastic transaction adjusts its size dynamically by cutting it into subsequences of accesses at runtime. The library programmer must use BEGIN_EL_TX to differentiate elastic and normal transactions. The application programmer does not have to care about whether elastic transactions are used.

Elastic Transaction Improvement WithoutWith

Elastic Transaction Improvement WithoutWith

Elastic Transaction Improvement WithoutWith

Elastic Transaction Improvement WithoutWith

Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) R(t) W(y) END_TX insert(z) May I cut the tx here?

Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) Yes!

Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX No!

Key Idea: Cutting transactions dynamically How do elastic transactions work? BEGIN_TX R(h) R(y) ABORT END_TX BEGIN_TX R(h) R(y) W(h) END_TX insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX The elastic transaction aborts if there is no way to cut

How is a cut achieved? A cut of an elastic transaction e is well- formed if : BEGIN_EL_T X R(*) W(*) END_TX

How is a cut achieved? A cut of an elastic transaction e is well- formed if : all subsequences contain at least 2 operations BEGIN_EL_T X R(*) W(*) END_TX

How is a cut achieved? A cut of an elastic transaction e is well- formed if : all subsequences contain at least 2 operations all writes of e belong to the same sub- sequence BEGIN_EL_T X R(*) W(*) END_TX

How is a cut achieved? A cut of an elastic transaction e is well- formed if : all subsequences contain at least 2 operations all writes of e belong to the same sub- sequence all sub-sequences start with a read (unless e starts writing) BEGIN_EL_T X R(*) W(*) END_TX

How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written.

How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written. This avoids: R(x) R(y) W(x) W(y) NO R(x) W(x) NO

How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written. This avoids: This allows: R(x) R(y) W(x) R(x) R(y) W(y) R(x) R(y) W(x) W(y) OK NO R(x) W(x) NO

Elastic-opacity: A history is elastic-opaque if there are consistent cuts such that replacing each elastic tx e by its resulting subsequences form an opaque history. Elastic Guarantees

Elastic Transaction Guarantees Elastic transactions: weaker than regular ones BEGIN_TX R(h) R(a) R(b) … W(z) END_TX delete(q) BEGIN_EL_TX R(h) R(a) R(b) … W(z) END_TX delete(q) Cut

Is there a limitation? Elastic tx apply to most common operations – In linked lists, skip lists, hash tables, red-black trees… Elastic tx apply to most common operations –Ex: delete(*)/search(*)/insert(*)/move(*,*)… Elastic tx do not apply to complex operations –sumAll() –conditionalWrite() z z y y t t x x h h

No! For complex operations, use regular transactions Both type of transactions combine safely sumAll() / conditionalWrite() z z y y t t x x h h BEGIN_EL_TX R(h) R(x) R(y) R(z) END_TX BEGIN_RL_TX R(h) R(x) R(y) R(z) R(t) END_TX search(z) sumAll()

Related Work Fine-grained locking: Efficient parsing of data structure Early release: Some reads may be forgotten (release() method) Commutative operations: High-level commutative ops do not conflict Boosting / Open nesting: Take effect before commit-time Abstract nesting: Partial roll-back mechanism

Related Work Fine-grained locking: Efficient parsing of data structure Does not support composition Early release: Some reads may be forgotten (release() method) Programmer must know when and what to release Commutative operations: High-level commutative ops do not conflict Static identification of commutative operations is too restrictive Boosting / Open nesting: Take effect before commit-time Complex roll-back mechanism must be defined Abstract nesting: Partial roll-back mechanism Minimize abort costs, not the amount of unnecessary aborts

Conclusion Elastic transaction New transactional model

Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code

Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code Composable Elastic and regular transactions are composable

Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code Composable Elastic and regular transactions are composable Efficient Speedup frequently executed operations

Conclusion Elastic transaction New transactional model Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code Composable Elastic and regular transactions are composable Efficient Speedup frequently executed operations Future work Characterize the requirements to use elastic transactions

Thank you