Transactional Contention Management as a Non-Clairvoyant Scheduling Problem Alessia Milani [Attiya et al. PODC 06] [Attiya and Milani OPODIS 09]

Slides:



Advertisements
Similar presentations
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Advertisements

Database Systems (資料庫系統)
Concurrency Control WXES 2103 Database. Content Concurrency Problems Concurrency Control Concurrency Control Approaches.
Unit 9 Concurrency Control. 9-2 Wei-Pang Yang, Information Management, NDHU Content  9.1 Introduction  9.2 Locking Technique  9.3 Optimistic Concurrency.
1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Concurrency Control Chapter 17 Sections
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Scheduling-based TM Contention Management A survey talk 3 rd workshop on the Theory of Transactional Memory, Sep 22-23, 2011, Rome Danny Hendler Ben-Gurion.
Online Scheduling with Known Arrival Times Nicholas G Hall (Ohio State University) Marc E Posner (Ohio State University) Chris N Potts (University of Southampton)
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Inherent limitations on DAP TMs 1 Inherent Limitations on Disjoint-Access Parallel Transactional Memory Hagit Attiya, Eshcar Hillel, Alessia Milani Technion.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches Marcin Bieńkowski.
1 Chapter 3. Synchronization. STEMPusan National University STEM-PNU 2 Synchronization in Distributed Systems Synchronization in a single machine Same.
A Programming Language View of Transactional Memory Hagit Attiya, Technion Joint work with Sandeep Hans, Alexey Gotsman and Noam Rinetzky Published in.
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
Transactions are back But are they the same? R. Guerraoui, EPFL.
SECTION 18.8 Timestamps. What is Timestamping? Scheduler assign each transaction T a unique number, it’s timestamp TS(T). Timestamps must be issued in.
Idit Keidar and Dmitri Perelman Technion 1 SPAA 2009.
CONCURRENCY CONTROL SECTION 18.7 THE TREE PROTOCOL By : Saloni Tamotia (215)
©Silberschatz, Korth and Sudarshan16.1Database System Concepts 3 rd Edition Chapter 16: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols.
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
Transactional contention Management as a Non- Clairvoyant Scheduling Problem Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir Presented by Anastasia.
Concurrency III (Timestamps). Schedulers A scheduler takes requests from transactions for reads and writes, and decides if it is “OK” to allow them to.
Algorithmics for Software Transactional Memory Hagit Attiya Technion.
Scheduling Memory Transactions Parallel computing day, Ben-Gurion University, October 20, 2009.
Distributed Transactional Memory Presented by Gala Yadgar.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Selfishness in Transactional Memory Raphael Eidenbenz, Roger Wattenhofer Distributed Computing Group Game Theory meets Multicore Architecture.
Transaction Processing: Concurrency and Serializability 10/4/05.
Transaction Management
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
1 Scalable Transactional Memory Scheduling Gokarna Sharma (A joint work with Costas Busch) Louisiana State University.
Competitive Analysis of Incentive Compatible On-Line Auctions Ron Lavi and Noam Nisan SISL/IST, Cal-Tech Hebrew University.
Concurrency Control John Ortiz.
Alternative Concurrency Control Methods R&G - Chapter 17.
© 1997 UW CSE 11/13/97N-1 Concurrency Control Chapter 18.1, 18.2, 18.5, 18.7.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Academic Year 2014 Spring Academic Year 2014 Spring.
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
An Introduction to Software Transactional Memory
Window-Based Greedy Contention Management for Transactional Memory Gokarna Sharma (LSU) Brett Estrade (Univ. of Houston) Costas Busch (LSU) 1DISC 2010.
CAR-STM: Scheduling-based Collision Avoidance and Reduction for Software Transactional Memory Shlomi Dolev, Danny Hendler and Adi Suissa PODC 2008.
1 Reducing Queue Lock Pessimism in Multiprocessor Schedulability Analysis Yang Chang, Robert Davis and Andy Wellings Real-time Systems Research Group University.
Scheduling policies for real- time embedded systems.
Concurrency Control Lectured by, Jesmin Akhter, Assistant professor, IIT, JU.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
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.
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
Competitive Queue Policies for Differentiated Services Seminar in Packet Networks1 Competitive Queue Policies for Differentiated Services William.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Operating Systems 1 K. Salah Module 2.2: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
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.
Timestamp-based Concurrency Control
Introductory Seminar on Research CIS5935 Fall 2008 Ted Baker.
Window-Based Greedy Contention Management for Transactional Memory Gokarna Sharma (LSU) Brett Estrade (Univ. of Houston) Costas Busch (LSU) DISC
Transactional Contention Management as a Non-Clairvoyant Scheduling Problem Hagit Attiya, Alessia Milani Technion, Haifa-LABRI, University of Bordeaux.
Concurrency Control.
Outline Introduction Background Distributed DBMS Architecture
Transactions are back But are they the same? R. Guerraoui , EPFL
Gokarna Sharma Costas Busch Louisiana State University, USA
Chapter 15 : Concurrency Control
An Optimal Lower Bound for Buffer Management in Multi-Queue Switches
Presentation transcript:

Transactional Contention Management as a Non-Clairvoyant Scheduling Problem Alessia Milani [Attiya et al. PODC 06] [Attiya and Milani OPODIS 09]

Optimism Transactions (Txs) proceed until a conflict occurs  T 1 conflicts with an on-going T 2 if T 1 tries to write to a data item previously accessed by T 2  one transaction aborts or waits for the other to complete  If no conflict occurs, they run in parallel

T1 Read(X)0 Write((Z)) ABORT T2 Write(X)1Read(Y) COMMIT Conflict Conservative approach A conflict does not imply a violation of serializability T1 and T2 can both commit without violating strict serializability

Contention manager mediates conflicts Decides which transaction aborts  E.g., the Greedy contention manager [Guerraoui et al. PODC 05] Each Tx is assigned a unique timestamp reflecting Txs real-time order If Txs T1 and T2 conflict, the Tx with the smaller timestamp aborts / waits Decides when to restart aborted Txs  E.g., CAR-STM [Dolev et al. PODC 08] the aborted Tx is not executed until the completion of the conflicting Tx  unrelated Txs may be executed serially

Need for a “clever” contention manager Complete the work quickly  makespan : Worst-case total time to complete all transactions Not waste work  do not repeate conflicts What Works and Why?

What Works and Why? In Practice [Scherer and Scott, CSJP 04] Extensive testing  Backoff  Aging  Randomized  Various priority …… None dominates on all benchmarks

What Works and Why? In Theory Contention Management as a Scheduling problem  Evaluate the throughput, measured by the makespan of a finite set of transactions Worst-case total time to complete all transactions  Relative to the makespan guaranteed by an optimal off-line scheduler

Non-Clairvoyant Scheduling A scheduler A does not know Txs characteristics a priori  Txs arrive one by one, and their duration is unknown Evaluated in comparison with an optimal, clairvoyant scheduler  knows the set of Txs, their data set, their release times and duration Competitive ratio :

Even if the contention manager is :  centralized A lower bound for CM Theorem 1. The competitive ratio of any work conserving CM is Ω(s) It always lets a maximal set of non-conflicting transactions run [Attiya et al. PODC 06]

Lower Bound: Workload The proof uses s 2 /2 transactions  s is the number of shared data items Each transactions access two data items All transactions  are available at time 0  have the same duration  may have a different data set if executed at different times or restarted

Lower Bound: First Requests Work conserving CM must select an independent set of s Txs E.g., column 1. s…ssss/2  …………  6…6663 4…4442 2…2221 s-1… s/2  …………  5…5553 3…3332 1…1111 …321

Lower Bound: Second Requests s…sss,1s/2  …………  6…666,13 4…444,12 2…222,11 s-1… s-1,2s/2  …………  5…555,23 3…333,22 1…111,21 s/2…321 Odd Txs all ask for 2 Even Txs all ask for 1 Only two Txs can complete

Lower Bound: Next Set s…2ks,3s,1s/2  …………  6…66,36,13 4…44,34,12 2…22,32,11 s-1… s-1,4s-1,2s/2  …………  5…55,45,23 3…33,43,22 1…11,41,21 s/2…321 Similarly… Only two Txs can complete from the second independent set of s Txs

Lower Bound: Repeat s,s-1…s,5s,3s,1s/2  …………  6,s-1…6,56,36,13 4,s-1…4,54,34,12 2,s-1…2,52,32,11 s-1,s…s-1,6s-1,4s-1,2s/2  …………  5,s…5,65,45,23 3,s…3,63,43,22 1,s…1,61,41,21 s/2…321 In general, at most two Txs from each independent set can complete

Makespan of Non-Clairvoyant Scheduler After aborting, all Txs request the same data item Makespan ≈ s,s-1…s,5s,3s,1s/2  …………  6,s-1…6,56,36,13 4,s-1…4,54,34,12 2,s-1…2,52,32,11 s-1,s…s-1,6s-1,4s-1,2s/2  …………  5,s…5,65,45,23 3,s…3,63,43,22 1,s…1,61,41,21 s/2…321

Makespan of Clairvoyant Scheduler Schedule an extended diagonal together s/2 independent Txs complete Makespan ≈ s s,s-1…s,5s,3s,1s/2  …………  6,s-1…6,56,36,13 4,s-1…4,54,34,12 2,s-1…2,52,32,11 s-1,s…s-1,6s-1,4s-1,2s/2  …………  5,s…5,65,45,23 3,s…3,63,43,22 1,s…1,61,41,21 s/2…321 Competitive ratio ≈ s

A matching Upper Bound Proved for the Greedy CM [Attiya et al. PODC 06] Relies on the fact that Txs write most of the time Theorem 2. Any work conserving CM with the pending commit property has O(s) competitive ratio at any time, some running transaction will execute uninterrupted until it commits

Read-Dominated Workloads Existing results hold for write-dominated workloads  Transactions need exclusive access for most of their duration (early-write transactions) [Guerraoui et al. PODC 05, Attiya et al. PODC 06] What about read-dominated workloads?  Read-only transactions  Late-write transactions k+1 134k … [Attiya & Milani. OPODIS 09]

It holds also for CM that has a more careful approach than being conservative Transactions :  have the same duration, are available at time 0  But may have a different data set if executed at different times or restarted Extending the lower bound to read- dominated workload Theorem 3. There is a read-dominated workload, s.t. the competitive ratio of any deterministic CM is Ω(s)

Lower Bound : Workload 12 … q 1 R 1 R q R q+1 W q+1 … 2 R 1 R q R q+2 W q+2 … … i R 1 R q R q+i W q+i … … q R 1 R q R 2q W 2q … 1 R 1 R 2 … R q-1 R q … 2 … … m-q R 1 R 2 … R q-1 R q … … … … … … …… ……

Makespan of Non-Clairvoyant Scheduler 12 … q 1 R 1 R q R q+1 W q+1 … 2 R 1 R q R q+2 W q+2 … … i R 1 R q R q+i W q+i … … q R 1 R q R 2q W 2q … q+1 R 1 R 2 … R q-1 R q … q+ 2 R 1 R 2 … R q-1 R q … … m … … … … … … …… …… Work conserving CM must select an independent set of m Txs e.g., 1 row plus m-q read-only Txs

Makespan of Non-Clairvoyant Scheduler 12 … q 1 R 1 R q R q+1 W q+1 … 2 R 1 R q R q+2 W q+2 … … i R 1 R q R q+i W q+i … … q R 1 R q R 2q W 2q … q+1 R 1 R 2 … R q-1 R q … q+ 2 R 1 R 2 … R q-1 R q … … m … … … … … … …… …… Only one Tx in a given row can commit Restarted Txs all request the same data item

Makespan of Non-Clairvoyant Scheduler 12 … q 1 R 1 …R q R 1 W 1 … 2 … … i … … q … q+1 … q+ 2 … … m … … … … …… …… At time q, still  q 2 late- write Txs to be executed We have to execute them serially q=s/2  Makespan To remove the work-conserving assumption : A Tx that starts after time q is [R 1 …R q R 1 W 1 ]

Makespan of the Clairvoyant Scheduler 12 … q 1 R 1 R q R q+1 W q+1 … 2 R 1 R q R q+2 W q+2 … … i R 1 R q R q+i W q+i … … q R 1 R q R 2q W 2q … q+1 R 1 R 2 … R q-1 R q … q+ 2 R 1 R 2 … R q-1 R q … … m … … … … … … …… …… Each column is an independent set of Txs At time q, all Txs are committed q=s/2  Makespan s Competitive ratio s

Theorem 4. There is a late-write workload,such that the competitive ratio of any deterministic conservative scheduler is Ω(m) A lower bound for conservative CM The makespan is not competitive even relative to a clairvoyant online scheduler [Dragojevic et al. PODC 09]  It has complete information on a transaction as it arrives

On Bimodal Workloads If a transaction writes, it writes from the very beginning Recent contention managers try to avoid repeated conflicts by serializing conflicting Txs  CAR-STM, Steal On Abort, ATS  They are conservative Ω(m) competitive ratio for read-dominated workloads (by Theorem 4)  also Ω(m) competitive ratio for bimodal workloads

CAR-STM scheduler T1 T2 Conflict T3 T2 Txs in execution Enqueued Txs T3 T1 is a writing Tx T2 and T3 and T5 are read-only Txs T5 T4 T6 T5T6 T5 T4 Serialize the execution of read-only Txs

Bimodal scheduler T1 T2 Conflict T3 T2 Txs in execution Enqueued Txs T3 Read-only queue T1 is a writing Tx T2 and T3 and T5 are read-only Txs T5 T4 T6 T5T6 T5 T2 T3 T5

 (s) [Attiya et al.]  (s)  (m) CAR-STM, ATS, SoA  (m) O(s) Bimodal  (s) derived from [Attiya et al.] O(m) trivial “Conservative” schedulerAny schedulerWORKLOADS WRITE- DOMINATED Early write BIMODAL : Early write + read-only READ- DOMINATED : Late write + read-only Summary &  “Conservative” schedulers decrease performance w/ read-dominated WL Can a “smarter” scheduler do better? At what cost? 3 & &  123 late-write Txs are more difficult to handle than read-only Txs