A BORTING C ONFLICTING T RANSACTIONS IN AN STM PP O PP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy.

Slides:



Advertisements
Similar presentations
Database Systems (資料庫系統)
Advertisements

1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
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.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control II
Cs4432concurrency control1 CS4432: Database Systems II Lecture #23 Concurrency Control Professor Elke A. Rundensteiner.
Concurrency Control Enforcing Serializability by Locks
Cs4432concurrency control1 CS4432: Database Systems II Lecture #22 Concurrency Control: Locking-based Protocols Professor Elke A. Rundensteiner.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Concurrency Control Chapter 17 Sections
Topic 6.3: Transactions and Concurrency Control Hari Uday.
Lecture 12 Transactions: Isolation. Transactions What’s hard? – ACID – Concurrency control – Recovery.
Lock-Based Concurrency Control
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
Quick Review of Apr 29 material
Concurrent Transactions Even when there is no “failure,” several transactions can interact to turn a consistent state into an inconsistent state.
ICS 421 Spring 2010 Transactions & Concurrency Control (i) Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa.
Concurrency Control and Recovery In real life: users access the database concurrently, and systems crash. Concurrent access to the database also improves.
Distributed Systems 2006 Styles of Client/Server Computing.
1 MetaTM/TxLinux: Transactional Memory For An Operating System Hany E. Ramadan, Christopher J. Rossbach, Donald E. Porter and Owen S. Hofmann Presenter:
Concurrency. Busy, busy, busy... In production environments, it is unlikely that we can limit our system to just one user at a time. – Consequently, it.
Transaction Processing: Concurrency and Serializability 10/4/05.
Transaction Management
CS510 Concurrent Systems Class 13 Software Transactional Memory Should Not be Obstruction-Free.
Concurrency. Correctness Principle A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
CS4432transaction management1 CS4432: Database Systems II Lecture #23 Transaction Management Professor Elke A. Rundensteiner.
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
Concurrency control in transactional systems Jinyang Li Some slides adapted from Stonebraker and Madden.
08_Transactions_LECTURE2 DBMSs should guarantee ACID properties (Atomicity, Consistency, Isolation, Durability). This is typically done by guaranteeing.
The Linux Kernel: A Challenging Workload for Transactional Memory Hany E. Ramadan Christopher J. Rossbach Emmett Witchel Operating Systems & Architecture.
Chapterb19 Transaction Management Transaction: An action, or series of actions, carried out by a single user or application program, which reads or updates.
EazyHTM: Eager-Lazy Hardware Transactional Memory Saša Tomić, Cristian Perfumo, Chinmay Kulkarni, Adrià Armejach, Adrián Cristal, Osman Unsal, Tim Harris,
Databases Illuminated
Introduction to Data Management CSE 344 Lecture 23: Transactions CSE Winter
Concurrency control In production environments, it is unlikely that we can limit our system to just one user at a time. – Consequently, it is possible.
Transactions CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
Dependence-Aware Transactional Memory for Increased Concurrency Hany E. Ramadan, Christopher J. Rossbach, Emmett Witchel University of Texas, Austin.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Page 1 Concurrency Control Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
1 Concurrency Control Lecture 22 Ramakrishnan - Chapter 19.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
Concurrency Control Introduction Lock-Based Protocols
1 Concurrency control lock-base protocols timestamp-based protocols validation-based protocols Ioan Despi.
1 Database Systems ( 資料庫系統 ) December 27, 2004 Chapter 17 By Hao-hua Chu ( 朱浩華 )
Hany E. Ramadan and Emmett Witchel University of Texas at Austin TRANSACT 2/15/2009 The Xfork in the Road to Coordinated Sibling Transactions.
CSE544: Transactions Concurrency Control Wednesday, 4/26/2006.
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
Solving Difficult HTM Problems Without Difficult Hardware Owen Hofmann, Donald Porter, Hany Ramadan, Christopher Rossbach, and Emmett Witchel University.
Jinze Liu. ACID Atomicity: TX’s are either completely done or not done at all Consistency: TX’s should leave the database in a consistent state Isolation:
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Transaction Management
CS422 Principles of Database Systems Concurrency Control
Concurrency Control.
Transaction Management
Changing thread semantics
Transaction Management
Chapter 10 Transaction Management and Concurrency Control
Chapter 15 : Concurrency Control
ENFORCING SERIALIZABILITY BY LOCKS
Software Transactional Memory Should Not be Obstruction-Free
Transaction Management
Database Management System
Submitted to Dr. Badie Sartawi Submitted by Nizar Handal Course
Database Systems (資料庫系統)
Lecture 18: Concurrency Control
Database Systems (資料庫系統)
Presentation transcript:

A BORTING C ONFLICTING T RANSACTIONS IN AN STM PP O PP’09 2/17/2009 Hany Ramadan, Indrajit Roy, Emmett Witchel University of Texas at Austin Maurice Herlihy Brown University Committing

TM AND ITS DISCONTENTS Contention is a challenge for TM Performance suffers due to aborts/stalls Transactions become serialized, just like locks ! Contention manifests as conflicts Write-sharing (e.g. counters) Structural, not semantic conflicts (e.g. lists) Solutions often sacrifice TM advantages Complicate programming model, weaken semantics 2 Contention LocksTM High Low

S TATE O F THE A RT M ITIGATES P ROBLEM Conflict management Karma, Polka, Kindergarten, Eruption, Polite, Timestamp, … [Scherer&Scott07] API/programming model Galois [Kulkarni07], Boosting [Herlihy08] ANTs [Harris07] Escape actions [Zilles06], Early release [Skare06] Open nesting [Moss05] Isolation TSTM [Adyonat08], SI-STM [Riegel06] Dependence-Aware Transactional Memory (DATM): transparency AND performance 3

E XAMPLE OF C ONFLICTS Conflicting working sets : Our approach: No API changes Concepts clarified: Isolated != Conflict-free 4 A: atomic { //work counter += 10 } B: atomic { // work tmp = counter counter = tmp + 10 }

DATM I MPROVES P ERFORMANCE arbitrate Lazy (e.g. TCC) Eager (MetaTM,LogTM) DATM xend xbegin xend xbegin xend xbegin xend xbegin xend conflict xbegin T1 T2 T1 T2 T1 T2 conflict arbitrate conflict time serialized overlapped retry no retry! tctc (Lazy/Lazy: Updates buffered, conflict detection at commit time) (Eager/Eager: Updates in-place, conflict detection at time of reference) 5

TM T ODAY IS C ONSERVATIVE Serializable schedule Equivalent to some serial interleaving Conflict-serializability (CS) Order of conflicting operations is the same Two phase locking serializability (2PL) Growing phase: growing amount of mutual exclusion Shrinking phase: release mutual exclusion 2PL is ubiquitous The DB way: “Deny all who request my lock” The TM way: “Abort all who request my memory” 6 Serializable Conflict Serializable 2PL

TM S CHEDULES Not serializable Serial 2PL serializable Conflict-serializable 7 A: atomic { //work counter += 10 } Not serializable (Neither equivalent to A,B nor to B,A) B: atomic { //work tmp = counter counter = tmp + 10 }

TM S CHEDULES Not serializable Serial 2PL serializable Conflict-serializable 8 A: atomic { //work counter += 10 } Serial (A,B) B: atomic { //work tmp = counter counter = tmp + 10 }

TM S CHEDULES Not serializable Serial 2PL serializable Conflict-serializable 9 A: atomic { //work counter += 10 } 2PL (equivalent to A,B) B: atomic { //work  can’t read counter  finally allowed tmp = counter counter = tmp + 10 // more work }

TM S CHEDULES Not serializable Serial 2PL serializable Conflict-serializable 10 A: atomic { //work counter += 10 } Conflict-serializable (equivalent to A,B) B: atomic { //work tmp = counter counter = tmp + 10 }

TM S CHEDULES Not serializable Serial 2PL serializable Conflict-serializable 11 A: atomic { //work counter += 10 } How DATM is Conflict-serializable (equivalent to A,B) B: atomic { //work tmp = counter counter = tmp + 10 } Fwd Value Track dep.

C ONFLICTS BECOME D EPENDENCES Dependence Graph Transactions: nodes dependences: edges edges dictate commit order no cycles  conflict serializable … write X write Y read Z … Tx B … read X write Y write Z … Tx A Tx B RWRW WWWW WRWR Read-Write: A commits before B Write-Write: A commits before B Write-Read: forward data overwrite  abort A commits before B 12

F ORMAL MODEL AND PROOF Safety: Accepts only conflict-serializable schedules Completeness Accepts all conflict-serializable schedules Key Idea DATM tracks read/write dependences and aborts transactions only if cycles exist in the underlying serialization graph Note: implementations can reject some schedules for variety of reasons (e.g. imprecise deadlock detection) See paper for details… 13

D EPENDENCE R EQUIREMENTS Enforcing commit order Wait for dependences to resolve W R dependences Forward data Guarantee data is not stale Handle cyclic dependences Prevent Detect and abort Timeout Tracking multiple versions of data Beyond eager/lazy version management 14 Tx 2 Tx 1 Tx 3

DASTM P ROTOTYPES DASTM-C C, word-based DASTM-J Java, object-based Global metadata table (a la TL2) Require unique metadata structure per slice Metadata contains Multiple versions for each shared item Forward/receive flags 15

DASTM P ROTOTYPES (2) Optimize read-only data to avoid unnecessary dependences Deadlock detection Dreadlocks[Herlihy08] (DASTM-J) Timeout (DASTM-C) Vector-clocks to summarize dependences Used only for commit order Zombies are back ! 16

DASTM: E XPERIMENTAL S ETUP Sun T1 (Niagara) multi-core system 32 processing contexts (8 cores, 4 ctx/core) Memory: private L1 / shared L2 Linux Compare DASTM-C to TL2 Measure speedup, from 1 to 32 threads Benchmarks Counter micro-benchmark “think time” to simulate work STAMP benchmarks vacation – large transactions ssca2 – small transactions 17

DASTM-C: R ESULTS 18

C ONCLUSION DATM turns conflicts into commits Isolation != Conflict-free Transparent to programmer Doesn’t unnecessarily complicate TM API DATM is proven safe Prototypes demonstrate good performance 19