Supporting existing code in a transactional memory system Nate Nystrom Mukund Raghavachari IBM TRAMP 5 Mar 2007.

Slides:



Advertisements
Similar presentations
Transactional Memory Challenges: Workloads, Execution Model, and Implementation Colin Blundell & Milo M. K. Martin University of Pennsylvania {blundell,
Advertisements

Transactions generalities 1 Transactions - generalities.
Transaction Program unit that accesses the database
Wait-die Transactions given a timestamp when they arrive …. ts(T i ) T i can only wait for T j if ts(T i )< ts(T j )...else die T 1 (ts =10) T 2 (ts =20)
Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY
Transactions and Recovery Checkpointing Souhad Daraghma.
Manipulating Data Schedule: Timing Topic 60 minutes Lecture
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Rich Transactions on Reasonable Hardware J. Eliot B. Moss Univ. of Massachusetts,
Crash Recovery, Part 1 If you are going to be in the logging business, one of the things that you have to do is to learn about heavy equipment. Robert.
Recovery CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Transaction Processing. Objectives After completing this lesson, you should be able to do the following: –Define transactions effectively for an application.
9-1 Copyright  Oracle Corporation, All rights reserved. Data Manipulation Language A DML statement is executed when you: – Add new rows to a table.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Thread-Level Transactional Memory Decoupling Interface and Implementation UW Computer Architecture Affiliates Conference Kevin Moore October 21, 2004.
Jan. 2014Dr. Yangjun Chen ACS Database recovery techniques (Ch. 21, 3 rd ed. – Ch. 19, 4 th and 5 th ed. – Ch. 23, 6 th ed.)
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
1 Lecture 7: Transactional Memory Intro Topics: introduction to transactional memory, “lazy” implementation.
Transaction Management and Concurrency Control
Supporting Nested Transactional Memory in LogTM Authors Michelle J Moravan Mark Hill Jayaram Bobba Ben Liblit Kevin Moore Michael Swift Luke Yen David.
Chapter 19 Database Recovery Techniques. Slide Chapter 19 Outline Databases Recovery 1. Purpose of Database Recovery 2. Types of Failure 3. Transaction.
Copyright  Oracle Corporation, All rights reserved. 9 Manipulating Data: INSERT, UPDATE, DELETE.
Department of Computer Science Presenters Dennis Gove Matthew Marzilli The ATOMO ∑ Transactional Programming Language.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Chapter 5 Data Manipulation and Transaction Control Oracle 10g: SQL
1 Database Systems CS204 Lecture 21 Transaction Processing I Asma Ahmad FAST-NU April 7, 2011.
DBMS Transactions and Rollback Recovery Helia / Martti Laiho.
Transactions1 Unit of work on a database. Transactions2 Transactions, concept Logical unit of work on the database –Examples Transfer money from bank.
Extending Open64 with Transactional Memory features Jiaqi Zhang Tsinghua University.
Chapter 15 Recovery. Topics in this Chapter Transactions Transaction Recovery System Recovery Media Recovery Two-Phase Commit SQL Facilities.
Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML) statement Insert rows.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
Lecture 13 Advanced Transaction Models. 2 Protocols considered so far are suitable for types of transactions that arise in traditional business applications,
9 Manipulating Data. 9-2 Objectives At the end of this lesson, you should be able to: Describe each DML statement Insert rows into a table Update rows.
Giovanni Chierico | May 2012 | Дубна Data Concurrency, Consistency and Integrity.
Section 06 (a)RDBMS (a) Supplement RDBMS Issues 2 HSQ - DATABASES & SQL And Franchise Colleges By MANSHA NAWAZ.
Advanced Database- Dr. Arasteh1 Advanced Database Bahman Arasteh ( Ph.D, Software Engineering ) Department of Software Engineering, Azad University of.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Transactions.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 Transations.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
©Bob Godfrey, 2002, 2005 Lecture 17: Transaction Integrity and Concurrency BSA206 Database Management Systems.
10 1 Chapter 10 - A Transaction Management Database Systems: Design, Implementation, and Management, Rob and Coronel.
Oracle 10g Database Administrator: Implementation and Administration Chapter 10 Basic Data Management.
4 November 2005 CS 838 Presentation 1 Nested Transactional Memory: Model and Preliminary Sketches J. Eliot B. Moss and Antony L. Hosking Presented by:
Oracle 11g: SQL Chapter 5 Data Manipulation and Transaction Control.
SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL.
Free Transactions with Rio Vista Landon Cox April 15, 2016.
Database recovery techniques
Free Transactions with Rio Vista
CS 245: Database System Principles Notes 10: More TP
Transaction Management and Concurrency Control
Faster Data Structures in Transactional Memory using Three Paths
Databases & Consistency
Atomicity in Multithreaded Software
On transactions, and Atomic Operations
Lecture 6: Transactions
Chapter 10 Transaction Management and Concurrency Control
CS 245: Database System Principles Notes 10: More TP
Free Transactions with Rio Vista
Databases & Consistency
Outline Introduction Background Distributed DBMS Architecture
On transactions, and Atomic Operations
Outline Introduction Background Distributed DBMS Architecture
1 Manipulating Data. 2 Objectives After completing this lesson, you should be able to do the following:  Describe each data manipulation language (DML)
Database Recovery 1 Purpose of Database Recovery
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
Module 10: Creating Transactional Business Processes
Presentation transcript:

Supporting existing code in a transactional memory system Nate Nystrom Mukund Raghavachari IBM TRAMP 5 Mar 2007

2 Transactional memory Want to use TM for many software engineering reasons: simple concurrent programming model composability avoids common errors: deadlock, priority inversion … But, how does it interact with existing code? atomic { if (a.balance > n) { a.balance -= n; b.balance += n; } atomic { if (a.balance > n) { a.balance -= n; b.balance += n; }

3 Interacting with existing code Existing code may not fit into transactional model Some operations cannot be undone or redone e.g., I/O but maybe encapsulated by operations that can Disparate memory models database transactions explicit synchronization Consistency between TM-managed state and other state Access to existing code can restrict TM implementation Performance implications Working to address these issues in the DALI Project

4 Open operations and compensations Open operations Execute without locking, logging Programmer again responsible for concurrency control Compensations [Garcia-Molina 89] [Weimer, Necula 04] Record closure to be invoke when enclosing transaction rolls back Need to compensate at appropriate level of abstraction can be application, rather than library specific Implemented on top of AtomJava [Grossman, Hindman 05] open { c.executeUpdate(INSERT INTO orders VALUES ( + id... + )); } undo { c.executeUpdate(DELETE FROM orders WHERE oid = + id + ); } open { c.executeUpdate(INSERT INTO orders VALUES ( + id... + )); } undo { c.executeUpdate(DELETE FROM orders WHERE oid = + id + ); }

5 Expanders Use expanders [Warth, Stanojevic, Millstein 06] to simplify adaptation of non-transactional code Methods dispatched through expanders, which specify compensation code expander ListEx of List { void add(Object o) { open { inner.add(o); } undo { inner.remove(o); } }... } use ListEx; List l =...; l.add(x); // -> ListEx.add(x) // -> List.add(x) expander ListEx of List { void add(Object o) { open { inner.add(o); } undo { inner.remove(o); } }... } use ListEx; List l =...; l.add(x); // -> ListEx.add(x) // -> List.add(x)

6 Transaction event listeners Register handlers to be invoked at begin, commit, rollback expander PSEx of PrintStream { PSListener l = new PSListener(inner); void print(String s) { l.sb.append(s); } } class PSListener implements TransactionListener { StringBuffer sb; PrintStream out; void commit(Transaction t) { // flush buffer at outermost commit if (t.parent == null) out.print(sb.toString()); } expander PSEx of PrintStream { PSListener l = new PSListener(inner); void print(String s) { l.sb.append(s); } } class PSListener implements TransactionListener { StringBuffer sb; PrintStream out; void commit(Transaction t) { // flush buffer at outermost commit if (t.parent == null) out.print(sb.toString()); }

7 Integration of software and database transactions Transactions can access both transient and persistent state Use transaction event listeners to: Problems: multiple databases JDBC-specific problems: deadlock, auto-commit At begin:Create a savepoint At rollback:Rollback to savepoint Rollback software transactions At nested commit:Discard savepoint At outermost commit:Commit database transaction If successful commit S/W txn

8 Conclusions Integrating existing code into TM system presents several challenges Compensations, expanders, transaction listeners are abstractions that make this integration easier Implemented database transactions seamlessly Hard issues: Interaction of explicit synchronization and TM Consistency of TM-managed state and other state Strong consistency guarantees with open transactions Performance