Presented by: Dmitri Perelman.  Intro  “Don’t touch my read-set” approach  “Precedence graphs” approach  On avoiding spare aborts  Your questions.

Slides:



Advertisements
Similar presentations
Time-based Transactional Memory with Scalable Time Bases Torvald Riegel, Christof Fetzer, Pascal Felber Presented By: Michael Gendelman.
Advertisements

Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Database Systems (資料庫系統)
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
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.
Principles of Transaction Management. Outline Transaction concepts & protocols Performance impact of concurrency control Performance tuning.
Concurrency Control II
Relaxed Consistency Models. Outline Lazy Release Consistency TreadMarks DSM system.
IDIT KEIDAR DMITRI PERELMAN RUI FAN EuroTM 2011 Maintaining Multiple Versions in Software Transactional Memory 1.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
Transactional Locking Nir Shavit Tel Aviv University (Joint work with Dave Dice and Ori Shalev)
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
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.
Hybrid Transactional Memory Nir Shavit MIT and Tel-Aviv University Joint work with Alex Matveev (and describing the work of many in this summer school)
DMITRI PERELMAN ANTON BYSHEVSKY OLEG LITMANOVICH IDIT KEIDAR DISC 2011 SMV: Selective Multi-Versioning STM 1.
DMITRI PERELMAN IDIT KEIDAR TRANSACT 2010 SMV: Selective Multi-Versioning STM 1.
Idit Keidar and Dmitri Perelman Technion 1 SPAA 2009.
1 Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Algorithmics for Software Transactional Memory Hagit Attiya Technion.
1 Lecture 23: Transactional Memory Topics: consistency model recap, introduction to transactional memory.
Transaction Processing: Concurrency and Serializability 10/4/05.
Concurrency. Correctness Principle A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
The Cost of Privatization Hagit Attiya Eshcar Hillel Technion & EPFLTechnion.
Concurrency Control John Ortiz.
1 Lecture 10: TM Implementations Topics: wrap-up of eager implementation (LogTM), scalable lazy implementation.
An Introduction to Software Transactional Memory
AN OPTIMISTIC CONCURRENCY CONTROL ALGORITHM FOR MOBILE AD-HOC NETWORK DATABASES Brendan Walker.
Solution to Dining Philosophers. Each philosopher I invokes the operations pickup() and putdown() in the following sequence: dp.pickup(i) EAT dp.putdown(i)
Reduced Hardware NOrec: A Safe and Scalable Hybrid Transactional Memory Alexander Matveev Nir Shavit MIT.
School of Information Technologies Michael Cahill 1, Uwe Röhm and Alan Fekete School of IT, University of Sydney {mjc, roehm, Serializable.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 3 (26/01/2006) Instructor: Haifeng YU.
A Qualitative Survey of Modern Software Transactional Memory Systems Virendra J. Marathe Michael L. Scott.
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
Optimistic Methods for Concurrency Control By: H.T. Kung and John Robinson Presented by: Frederick Ramirez.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
1 CSE 480: Database Systems Lecture 24: Concurrency Control.
Hwajung Lee.  Improves reliability  Improves availability ( What good is a reliable system if it is not available?)  Replication must be transparent.
Timestamp-based Concurrency Control
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
Lecture 9- Concurrency Control (continued) Advanced Databases Masood Niazi Torshiz Islamic Azad University- Mashhad Branch
Database Isolation Levels. Reading Database Isolation Levels, lecture notes by Dr. A. Fekete, resentation/AustralianComputer.
Clock Snooping and its Application in On-the-fly Data Race Detection Koen De Bosschere and Michiel Ronsse University of Ghent, Belgium Taipei, TaiwanDec.
Lecture 20: Consistency Models, TM
Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III
Faster Data Structures in Transactional Memory using Three Paths
Transactions.
Concurrency Control via Validation
Replication and Consistency
Replication and Consistency
Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.
Concurrency Control II (OCC, MVCC)
Lecture 17: Transactional Memories I
Lecture 22: Consistency Models, TM
Distributed Transactions
Software Transactional Memory Should Not be Obstruction-Free
Transaction management
Lecture: Consistency Models, TM
File System Performance
Concurrency control (OCC and MVCC)
Replication and Consistency
Presentation transcript:

presented by: Dmitri Perelman

 Intro  “Don’t touch my read-set” approach  “Precedence graphs” approach  On avoiding spare aborts  Your questions

 Validation algorithm:  assumes non-overlapping transactional operations (transactions themselves do overlap)  responsible for guaranteeing correctness criterion  the main topic of our lecture read(x,0) read(y,0) write(y,1) write(x,1) T1: T2: Not serializable execution!

 Concurrency control:  supplies the “illusion” of non-overlapping transactional operations for the Validation module  depends on the needed progress guarantees (wait-free, lock-free, obstruction-free, blocking)  may use locks, CPU strong primitives  helping techniques  beyond the scope of the lecture

 Contention manager:  called in the cases, in which a set of transactions may not continue without violating the correctness criterion  “contention” is reported by the validation algorithm  beyond the scope of the lecture

 Serializability – equivalence to some sequential history  equivalent: same invocations, same responses  no demand of real-time order  only committed transactions care  Linearizability – serializability + real-time order  Opacity – linearizability + all the transactions care T1T1 T2T2 T3T3 CC C o1 o2 o3 o4 T2T2 C A o1 o2 o3 T1T1

 The number of “unnecessary aborts”  TM satisfies permissiveness 1 if it accepts every input pattern satisfying the correctness criterion. R.Guerraoui et al. Permissiveness in Transactional Memories. DISC 2008 T2T2 C o1 o2 T1T1 do we need to abort T 1 ?  Time complexity  Space complexity  related closely to garbage collection rules

 Intro  “Don’t touch my read-set” approach  “Precedence graphs” approach  On avoiding spare aborts  Your questions

 We will see now several TMs providing opacity  These TMs succeed to proceed if no concurrent transactions write to their read-set  if the read-set remains unchanged from the beginning of transaction, consistent snapshot is guaranteed

 DSTM 1 - the first and the straightforward implementation of untouchable read-set approach  Each object is accessed through a special “object handler”. M. Herlihy et al. STM for dynamic-sized data structures. PODC, object handler txn current previous data data’ status read-set txn descriptorobj locator

 Write operation installs the new object locator  Whenever Ti accesses the object with active owner transaction - abort.  don’t touch my read-set! object handler txn current previous data new commit read-set txn descriptor txn current previous active read-set my descriptor

 Reads are “invisible”  read does not let other transactions know about it  the writing txn cannot inform concurrent reader about the contention  Do not want to see illegal state: revalidate the read- set at each load operation  O(read-set) for each read operation. o1 o2 T1T1 T2T2 C

 Solves the problem of costly read-set revalidation  Global version clock (GVC) counts the number of updating committed transactions  when writing transactions successfully commits, it increments GVC  Each object has an associated version value  o.version is equal to the value of GVC at the moment of writing that version D.Dice et al. Transactional Locking II. DISC, 2006.

 Transaction remembers the value of GVC upon the startup in the local rv variable  Read operation of object o checks that o.version ≤ rv. If not, abort. T2T2 C o1 o2 T1T1 GC=0 ver=0 A GC=1 ver=1 T2T2 C o1 o2 T1T1 GC=0 ver=0 A GC=1 ver=1 need to abortclearly spare abort ver=1

 Writes are postponed till the commit (“invisible writes”)  allows concurrent writers  Commit of read-only transaction always returns success  Commit of updating transaction:  revalidate the read-set (no need if rv = GVC)  increment GVC, write the new values, update objects’ versions T2T2 C A o1 o2 T1T1 The reason for revalidating the read-set

 Invisible writes (TL2) allow more concurrency than the visible ones (DSTM).  Global Version Clock – no need to revalidate the read-set at every load operation.  This comes at the cost of being blocking (DSTM is obstruction-free)

 Lazy snapshot algorithm (LSA) – similar to TL2  But now the objects are multi-versioned:  each object keeps the list of versions  the writer installs the new version (instead of overriding the old one) T.Riegel et al. A Lazy Snapshot Algorithm with Eager Validation. DISC, object handler vnvn v n-1

 As in TL2, each object version i keeps its installation time o.v i  The validity range of object version i is the time range [o.v i, o.v i+1 ).  The validity range (vr) of the transaction is the intersection of validity ranges of the read-set  initialized to [GVC, ∞)  is updated after every read  should stay non-empty

 Read operation:  traverses the versions list from the latest one till finding the suitable version to read  version is suitable if its validity range has a nonempty intersection with T i vr.  Validity range of the latest version is still not known  it is temporarily assigned [o.v j, GVC], and marked as open  open objects’ ranges may be extended on demand  transaction is open while all the objects from its read-set are open T2T2 C o1 o2 T1T1

T2T2 C o1 o2 T1T1 vr = [x-10,x] GVC = x+1 vr = [x+1,x+1] vr = [x-10,x+1] GVC = x Expanding validity range on demand T2T2 C o1 o2 T1T1 vr = [x-10,x] GVC = x+1 vr = [x+1,x+1] GVC = x Expanding range is not possible – reading previous version

 Read-only transactions always commit successfully  If the transaction has a non-empty write-set:  the commit succeeds if the txn succeeds to increment GVC  the incremented GVC should have a nonempty intersection with txn’s validity range  transaction should be open for successful commit  transaction is open if no concurrent transactions touch its read- set

T2T2 C o1 o2 T1T1 T1 commits, because it is open (T1 would have to abort in TL2) T2T2 C o1 o2 T1T1 T1 commits, because it is read-only (any single versioned algorithm would have to abort) o3 C T2T2 o1 o2 T1T1 A T1 aborts, because it is not open (T2 has written to its read-set). Opacity is not violated C

 Multi-versioning: all the read-only transactions commit  Multi-versioning: additional level of indirection for object data access  increases the number of cache misses  Expanding validity ranges on demand may be costly  O(read-set) C o1 o2 T1T1 o3 C …

 A global clock may be a scalability limitation when the number of cores goes large  Thread Local Clock (TLC) 1 comes to solve these limitations  Object timestamp is appended with the tid of the writer. H.Avni and N.Shavit. Maintaining consistent transactional states without a global clock. SIROCCO, object timestamp object timestamptid  Each thread has a thread local clock  incremented at the start of every transaction  Each thread has a local clocks array  entry i of array keeps the last timestamp of thread i seen by the thread

 Write operation:  update the timestamp & tid.  Validating object’s timestamp:  abort if object’s timestamp is greater than the local array entry for the writer T2T2 o1 o2 T1T1 AC 12 thread 1 local array 112 tmstmp = 2, tid = 2 T2T2 o1 o2 T1T1 AC 12 thread 1 local array 112 tmstmp = 2, tid = 2

 Too conservative  The algorithms do not distinguish between the following scenarios T2T2 o1 o2 T1T1 A C T2T2 o1 o2 T1T1 A C

 Intro  “Don’t touch my read-set” approach  “Precedence graphs” approach  On avoiding spare aborts  Your questions

 Nodes of the graph – transactions.  Edges – transactions precedence info  If Ti reads from Tj, there is an edge Tj → Ti  If Tj installs o.v n-1 and Ti installs o.v n, there is an edge Tj → Ti  If Tj reads from o.v n-1 and Ti installs o.v n, there is an edge Tj → Ti object handle o.v n o.v n-1 writer readers

 A path from Ti to Tj in PG implies the order in the sequential history  The topological order on the graph gives a legal sequential history  If PG does not contain cycles, the history is serializable  It is sufficient to keep PG acyclic to ensure validity

 J. Napper and L. Alvisi presented the TM satisfying serializability based upon precedence graphs  the main focus of the article was making the solution lock-free  Read operation:  looks for the latest version which does not introduce cycles in PG  Reads are invisible, consistent snapshot is not revalidated till commit (don’t need it in serializability)  Writes install the new version after the latest one (postponed till commit)  Commit operation checks the precedence graph for acyclity J.Napper and L.Alvisi. Lock-free serializable transactions. Tech. report, 2005.

 Much more accurate than the “don’t touch my read-set” approach  We get it on the high computational cost  cycle detection takes O(|V| 2 )  Two questions remained opened:  garbage collection rules  path shortening techniques o1 o2 o3 o4 o5

 Intro  “Don’t touch my read-set” approach  “Precedence graphs” approach  On avoiding spare aborts  Your questions

 Opacity-permissiveness – every input pattern satisfying opacity is accepted  e.g. the history r 1 (0 1 ),w 2 (o 1 ),c 1,c 2  Unfortunately, no online TM may do it 1 I. Keidar and D. Perelman. On avoiding spare aborts in TM. Tech. report, T2T2 o1 o2 T1T1 AC o3 T3T3 what value should be returned to T2? T2T2 o1 o2 T1T1 AC o3 T3T3 T4T4

 Strict online opacity-permissiveness – abort only if cannot continue without violating opacity  Unfortunately, implies solving NP-complete problems

 Intuitively, the NP-completeness derives from the situations, in which there are several ways to serialize already committed transactions  We demand from the TM to define the serialization order of the committed transactions  this order should be persistent in every extension of the run  all the TMs we have seen so far do so implicitly  however, theoretically, TMs may not define serialization point of the committed transactions (e.g. commutative txns) What is the order of T 1,T 2,T 3 ? T1T1 T2T2 T3T3 T4T4

 The same story of building the precedence graph  The write operation has an option to install the version before the latest one  as if the write had happened in past  possible only for “blind writes”  Read operation is looking for the latest possible version to read without creating a cycle  Write operations are postponed till commit

 Commit operation should choose the “appropriate places” to install the new versions  greedy algorithm will not work T2T2 o1 o2 T1T1 A C o3 T3T3 C T2T2 o1 o2 T1T1 C o3 T3T3 C choosing to read from T2 leads to spare abort

 Intuitively, may remove the transactional node from the precedence graph if it cannot participate in the cycles any more  For example, if the node has no incoming edges and will not have the new ones in the future  This lecture was not intended to be sadistic  interested students are welcome to read the tech report :)

 Even after all the optimizations, avoiding spare aborts implies a high cost  and what is the inherent lower bound?  Weakening correctness criterion can help  there exists TM satisfying causal serializability that uses vector clocks  causal serializability is weaker than serializability  different processors may perceive some events in different order as long as the individual views preserve the causality relation