Sathya Peri, IIT Patna, India, K.Vidyasankar, Memorial University, St John’s, Canada, 1 Efficient Non-Blocking.

Slides:



Advertisements
Similar presentations
CM20145 Concurrency Control
Advertisements

Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Transaction Management: Concurrency Control CS634 Class 17, Apr 7, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
TRANSACTION PROCESSING SYSTEM ROHIT KHOKHER. TRANSACTION RECOVERY TRANSACTION RECOVERY TRANSACTION STATES SERIALIZABILITY CONFLICT SERIALIZABILITY VIEW.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
Sathya Peri IIT Patna 1 Understanding the Requirements of STMs.
Presented by Dr. Greg Speegle.  Concurrency Control  Multiple Versions  Version number timestamp of writing transaction  Read last committed value.
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Lock-Based Concurrency Control
Universität Karlsruhe (TH) © 2006 Univ,Karlsruhe, IPD, Prof. Lockemann/Prof. BöhmTAV 4 Chapter 4 Isolation: Correctness in the read/write model.
Safety Definitions and Inherent Bounds of Transactional Memory Eshcar Hillel.
Nested Parallelism in Transactional Memory Kunal Agrawal, Jeremy T. Fineman and Jim Sukha MIT.
Concurrent Transactions Even when there is no “failure,” several transactions can interact to turn a consistent state into an inconsistent state.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Granularity of Locks and Degrees of Consistency in a Shared Data Base John LaFontaine Haixuan Sun.
©Silberschatz, Korth and Sudarshan15.1Database System ConceptsTransactions Transaction Concept Transaction State Implementation of Atomicity and Durability.
Supporting Nested Transactional Memory in LogTM Authors Michelle J Moravan Mark Hill Jayaram Bobba Ben Liblit Kevin Moore Michael Swift Luke Yen David.
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.
Concurrency. Correctness Principle A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
Database Management Systems I Alex Coman, Winter 2006
1 Introduction to Transaction Processing (1)
©Silberschatz, Korth and Sudarshan17.1Database System Concepts Chapter 17: Recovery System Failure Classification Storage Structure Recovery and Atomicity.
Transactions Amol Deshpande CMSC424. Today Project stuff… Summer Internships 
Concurrency Control John Ortiz.
©Silberschatz, Korth and Sudarshan17.1Database System Concepts 3 rd Edition Chapter 17: Recovery System Failure Classification Storage Structure Recovery.
1 Concurrency Control. 2 Transactions A transaction is a list of actions. The actions are reads (written R T (O)) and writes (written W T (O)) of database.
BACS 485—Database Management Concurrency Control Overview of Database Concurrency Control.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Concurrency Control.
CIS 720 Concurrency Control. Locking Atomic statement –Can be used to perform two or more updates atomically Th1: …. ;……. Th2:…………. ;…….
1 B Trees - Motivation Recall our discussion on AVL-trees –The maximum height of an AVL-tree with n-nodes is log 2 (n) since the branching factor (degree,
Transactions Sylvia Huang CS 157B. Transaction A transaction is a unit of program execution that accesses and possibly updates various data items. A transaction.
AXML Transactions Debmalya Biswas. 16th AprSEIW Transactions A transaction can be considered as a group of operations encapsulated by the operations.
Transaction Lectured by, Jesmin Akhter, Assistant professor, IIT, JU.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
Chapter 16 Recovery Yonsei University 1 st Semester, 2015 Sanghyun Park.
©Silberschatz, Korth and Sudarshan15.1Database System Concepts Chapter 15: Transactions Transaction Concept Transaction State Implementation of Atomicity.
Lecture 13 Advanced Transaction Models. 2 Protocols considered so far are suitable for types of transactions that arise in traditional business applications,
Classification of Weak Correctness Criteria for Real-Time Database Applications Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.
Chapter 10 Recovery System. ACID Properties  Atomicity. Either all operations of the transaction are properly reflected in the database or none are.
Chapter 15: Transactions Transaction Concept Transaction State Implementation of Atomicity and Durability Concurrent Executions Serializability Recoverability.
Degrees of Isolation – A Theoretical Formulation Presented by Balaji Sethuraman.
Chapter 17: Recovery System
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 14: Transactions.
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
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
SHUJAZ IBRAHIM CHAYLASY GNOPHANXAY FIT, KMUTNB JANUARY 05, 2010 Distributed Database Systems | Dr.Nawaporn Wisitpongphan | KMUTNB Based on article by :
4 November 2005 CS 838 Presentation 1 Nested Transactional Memory: Model and Preliminary Sketches J. Eliot B. Moss and Antony L. Hosking Presented by:
Assignment 6 - Solution Problem 1 Suppose a transaction sets an intention-write lock on a file and later sets a write lock on a record of the file. Is.
Database Recovery Zheng (Godric) Gu. Transaction Concept Storage Structure Failure Classification Log-Based Recovery Deferred Database Modification Immediate.
16.1Database System Concepts - 6 th Edition Chapter 16: Recovery System Failure Classification Storage Structure Recovery and Atomicity Log-Based Recovery.
Contents. Goal and Overview. Ingredients. The Page Model.
Computational Models Database Lab Minji Jo.
Transaction Management and Concurrency Control
Part- A Transaction Management
CSIS 7102 Spring 2004 Lecture 2 : Serializability
Temple University – CIS Dept. CIS661 – Principles of Data Management
Lecture 21: Concurrency & Locking
Outline Introduction Background Distributed DBMS Architecture
Module 17: Recovery System
Lecture 21: Intro to Transactions & Logging III
Transactions with Nested Parallelism
Ranjeet Kumar K. Vidyasankar Memorial University St. John’s CANADA
C. Faloutsos Transactions
Temple University – CIS Dept. CIS616– Principles of Data Management
Outline Introduction Background Distributed DBMS Architecture
Presentation transcript:

Sathya Peri, IIT Patna, India, K.Vidyasankar, Memorial University, St John’s, Canada, 1 Efficient Non-Blocking Conflict Notion for Nested Transactions

Overview 2 Introduction to Closed Nested Transactions Write and Read operations in closed nested transactions lastWrite definition Specification of lastWrite operations for read: Blocking specifiction, lwSpec Non-blocking specification, nblwSpec Non-blocking Conflict notion

Nesting of Transactions 3 A transaction is nested: if it invokes another transaction Composing of transaction can be achieved through nesting Composition: basis of modular programming Different types of nesting: Closed, Open and Flat

Our Focus: Closed Nesting 4 We focus only on nested transactions with read and write operations Let P be a parent transaction which invokes a sub-transaction S In closed nesting, when the sub-transaction S commits its effects are not visible to other 'external' transactions immediately, i.e., it is local they become visible when its parent transaction P commits Abort of the sub-transaction S has no affect on P

Illustration: Closed Nesting 5 Memory x=5 P S Q Closed Nesting x=10 write(x,10) read(x) = 5 read(x) = 10 committed

Background Information: Schedule Representation Schedule: r 11 (x) r 211 (y) w 212 (y) c 21 w 12 (y) c 1 r 221 (y) w 222 (z) c 22 a 2 r 31 (z) w 32 (b) c 1 6 tRtR t1t1 t2t2 t3t3 t 21 t 22 r 211 (y)w 212 (y) r 221 (y) w 222 (z) w 32 (b) r 31 (z) r 11 (x) w 12 (y) t init t fin

Write Operation – Lazy Write approach A transaction maintains a local buffer for every data-item it writes to. All the writes of a transaction are onto the local buffers. When the transaction commits, the contents of the buffers are merged with its parent’s buffers. On abort the buffers are discarded 7

Schedule Augmentation: Commit Writes We augment a schedule with extra write operations: Commit Write operations In a schedule, There is a commit-write operation for every data-item, a committed (sub)transaction writes to Aborted (sub) transactions do not have commit-write operations A commit-write represents the merging of a write of a transaction on a data-item with its parent’s write Simple memory write operation’s commit write is itself 8

Background Information: Schedule Representation Augmented Schedule: r 11 (x) r 211 (y) w 212 (y) w (y) c 21 w 12 (y) w 1 12 (y) c 1 r 221 (y) w 222 (z) w (z) c 22 a 2 r 31 (z) w 32 (b) w 3 32 (b) c 3 9 tRtR t1t1 t2t2 t3t3 t 21 t 22 r 211 (y)w 212 (y) r 221 (y) w 222 (z) w 32 (b) r 31 (z) r 11 (x) w 12 (y) t init t fin

Observation on Write and Commit Operations The write operation of a nested transaction t s involves only its local buffers The commit of a sub-transaction t s with parent t p only involves the buffers of t p Observation: Write and Commit operations be implemented atomically, possibly using locks 10

Read Operation – Closest Ancestor A transaction performing a read operation on data-item d starts with its local write buffers. If the data item is not present, then it accesses the buffers of its ancestors in increasing order of height reads from the buffers of an ancestor closest to it A write operation read by a given read operation is denoted as the read’s lastWrite. 11

lastWrite Specification: Non-nested transactions In single version database schedules, the lastWrite for a read operation r i (x) belonging to transaction t i is: The previous closest write on the data-item x by a transaction t i, w j (x) For instance consider the following schedule of non-nested transactions: r 1 (x) r 2 (x) w 1 (z) r 2 (y) w 2 (y) r 1 (z) w 3 (z) lastWrite of r 1 (z) is w 1 (z) 12

lastWrite Specification: Nested transactions In nested transactions, by reading from the closest ancestor the notion of lastWrite can be defined The lastWrite of a read operation r i (x) in a nested transaction is either a simple write or committed write w j (x) which: Occurs before the read Is a peer of the read or the peer of an ancestor of the read Is closest in terms of tree height Is closest in terms of schedule distance We denote this specification of lastWrite as lwSpec 13

Examples of LastWrite using lwSpec r 11 (x) : init(x), r 211 (y):init(y), r 221 (y): w (y) r 31 (z):init(z) 14 tRtR t1t1 t2t2 t3t3 t 21 t 22 r 211 (y)w 212 (y) r 221 (y) w 222 (z) w 32 (b) r 31 (z) r 11 (x) w 12 (y) t init t fin

Limitations of lwSpec lwSpec implicitly assumes that the read operations are atomic Specifically, it assumes that no other operation is being executed when a read is in progress A read operation that follows closest ancestor option, involves buffers of multiple transactions Hence can not be implemented atomically Each read operation is represented as a leaf node in the tree To correctly capture the read, we assume that the node implies the instant the read completes 15

Limitations of lwSpec: illustration Consider a nested transaction t i at level 10 (in the tree) wishing to read x, r i (x). Consider this sequence When the control (of the read) reaches a transaction t j at level 9, it does not find any buffer for x The control goes to transaction t k at level 8 and still does not find x. At that point suppose transaction t j writes to x The control finally reaches a transaction t j at level 7 and reads x This implies that the last two conditions of the lwSpec are not true. 16

Non-blocking lastWrite Specification: nblwSpec The lastWrite of a read operation r i (x) in a nested transaction is either a simple write or committed write w j (x) which: Occurs before the read Is a peer of the read or the peer of an ancestor of the read We denote this specification of lastWrite as nblwSpec It must be noted that given a schedule, for a given read r i (x), there could be multiple writes in the schedule that satisfy the nblwSpec (unlike lwSpec, where there is only one write) thus, in this case an external entity should specify the lastWrite for each read operation 17

lastWrite Specification and Conflict notion Based on the specification of the lastWrite, the correctness for the correctness criteria can be defined Two data operations on the same data-item are conflicting: if one of them is a write operation Then, based on the correctness criteria, accurate conflict notions can be defined Using accurate conflict notion, efficient algorithms can be devised Similar to Conflict Serializability in databases 18

External Reads For a transaction, we define External-read: A read operation belonging to a descendant, whose lastWrite is external to the transaction A simple-memory read is an external read of itself 19

Non-blocking Conflict Notion For any two nodes (transactions/simple memory operations) in the tree n a and n b, which contain two operations o a and o b are in conflict if: w-w conflict: o a and o b are commit-writes respectively w a and w b w-r conflict: o a is a commit-write of n a, w a and o b is an external read of n b, r b. r-w conflict: o a is an external-read of n a, r a and o b is a commit-write of n b,w b.Let the lastWrite of r a be w l. This conflict is true if S.ord(w l ) < S.ord(w b ) and S.level(w l ) < S.level(w b ) 20

Conclusion Characterized the non-blocking specification of lastWrites, nblwSpec Developed conflict notions based on these non-blocking specification 21

Questions? 22