Signature Based Concurrency Control Thomas Schwarz, S.J. JoAnne Holliday Santa Clara University Santa Clara, CA 95053

Slides:



Advertisements
Similar presentations
Concurrency Control III. General Overview Relational model - SQL Formal & commercial query languages Functional Dependencies Normalization Physical Design.
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
Serializable Isolation for Snapshot Databases Michael J. Cahill, Uwe Röhm, and Alan D. Fekete University of Sydney ACM Transactions on Database Systems.
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 5: Tree-based Concurrency Control and Validation Currency Control Professor.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
1 Chapter 3. Synchronization. STEMPusan National University STEM-PNU 2 Synchronization in Distributed Systems Synchronization in a single machine Same.
Exercises for Chapter 17: Distributed Transactions
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
Transaction Processing Lecture ACID 2 phase commit.
Distributed Systems 2006 Styles of Client/Server Computing.
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
CS 582 / CMPE 481 Distributed Systems
Concurrency III (Timestamps). Schedulers A scheduler takes requests from transactions for reads and writes, and decides if it is “OK” to allow them to.
Transaction Management and Concurrency Control
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
18.8 Concurrency Control by Timestamps - Dongyi Jia - CS257 ID:116 - Spring 2008.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
© 1997 UW CSE 11/13/97N-1 Concurrency Control Chapter 18.1, 18.2, 18.5, 18.7.
Concurrency Control In Dynamic Database Systems Laurel Jones.
Transactions and concurrency control
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
Using Algebraic Signatures in Storage Applications Thomas Schwarz, S.J. Associate Professor, Santa Clara University Associate, SSRC UCSC Storage Systems.
Distributed Transactions March 15, Transactions What is a Distributed Transaction?  A transaction that involves more than one server  Network.
DISTRIBUTED DATABASE SYSTEM.  A distributed database system consists of loosely coupled sites that share no physical component  Database systems that.
Transaction Communications Yi Sun. Outline Transaction ACID Property Distributed transaction Two phase commit protocol Nested transaction.
CS 245Notes 101 CS 245: Database System Principles Notes 10: More TP Hector Garcia-Molina.
Distributed Transactions
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Data Versioning Lecturer.
Department of Computer Science and Engineering, HKUST 1 More on Isolation.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
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.
Databases Illuminated
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Distributed synchronization and mutual exclusion Distributed Transactions.
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.
7c.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Module 7c: Atomicity Atomic Transactions Log-based Recovery Checkpoints Concurrent.
Page 1 Concurrency Control Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Chapter 20 Transaction Management Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation and Management, 4 th Edition,
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
IM NTU Distributed Information Systems 2004 Distributed Transactions -- 1 Distributed Transactions Yih-Kuen Tsay Dept. of Information Management National.
1 CSE232A: Database System Principles More Concurrency Control and Transaction Processing.
Timestamp-based Concurrency Control
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Introduction and File Structures Database System Implementation CSE 507 Some slides adapted from R. Elmasri and S. Navathe, Fundamentals of Database Systems,
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.
Distributed Transactions What is a transaction? (A sequence of server operations that must be carried out atomically ) ACID properties - what are these.
Topics in Distributed Databases Database System Implementation CSE 507 Some slides adapted from Navathe et. Al and Silberchatz et. Al.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Transactions Examples
Transaction Management and Concurrency Control
Outline Announcements Fault Tolerance.
Concurrency Control Chapter 17
Replication and Recovery in Distributed Systems
Distributed Transactions
Concurrency Control Chapter 17
Database Management System
Presentation transcript:

Signature Based Concurrency Control Thomas Schwarz, S.J. JoAnne Holliday Santa Clara University Santa Clara, CA

Overview Transactional concurrency control in a distributed system: Signatures are a better version of version numbers. Signatures are calculated from the records.

Basic Idea A signatures is a short string of f bits calculated from a record. We assume here an LH* file scenario. File is a dictionary data structure associating keys with a non-key field: key cnon-key field signature

Basic Idea When a transaction reads a record it records the signature of the record. When the transaction is ready to commit, it checks whether any signatures of records it read have changed. If this is the case, the transaction restarts. Otherwise, it commits.

Basic Idea Danger of false negative: Two different records can have the same signature. Control the probability of false negatives by the length of the signature (16B) MD5, (20B) SHA1 are excepted in computer forensics.

Simple Signature Scheme Each transaction i contains atomic operations: R i (x) – Read record x W i (x) – Write record x V i (x) – Verify the signature of record x A i – Abort C i – Commit

Simple Signature Scheme Rules for transaction i All reads precede all verify. All verifies precede all writes. If another transaction j writes to x between a read and a verify, then transaction i aborts. If all verifies are successful, then the transaction does all its writes and commits.

Simple Signature Scheme Dirty Reads: R i (x)  W j (x)  A j  C i or R i (x)  W j (x)  C i  A j Impossible, because a transaction that writes also commits.

Simple Signature Scheme Fuzzy Reads: R i (x)  W j (x)  C j  R i (x)  Possible only if we were to allow multiple reads to the same item x: R 1 (x) W 2 (x) C 2 R 1 (x) V 1 (x) C 1.

Simple Signature Scheme If we do all the reads in a single block: Has arguably ANSI REPEATABLE READ property. Even has ANSI ANOMALY SERIALIZABLE. But it is certainly not serializable: R 1 (x) R 2 (x) R 1 (y) R 2 (y) V 1 (x) V 2 (x) V 1 (y) V 2 (y) W 1 (x) W 2 (x) W 2 (y) W 1 (y) C 1 C 2

Extended Signature Scheme Add: Verify-Write phase is atomic. Then: Scheme is (conflict) serializable. Proof (Idea): Consider all reads to be “pre-reads”. Only the verify operations are read in the sense of concurrency control. Then the result follows by definition.

Implementation Lock based implementation: Read-Calculate Phase No locking at all. However, a transaction that reads an exclusively locked record might want to reread that record because that record might change. Verify-Write Phase Read lock on all the signatures of records read. Write lock on all the signatures of records to be modified. Verify signatures and decide on commit / abort. Release all locks.

Implementation Lock based implementation: Conservative Strict Two-Phase Locking Locks are short-lived: One round of messages to acquire locks and signatures. One round of messages for commit / abort and release messages.

Implementation No-locking scheme Transaction appear to servers to be very short. Chance for conflict limited.

Signature Implementation We do not use the record signature directly, but a region signature. A region is a contiguous set of keys that all hash to the same bucket. Typically, a region should have between 0.5 and 5 records on average.

Signature Implementation Let c i be the keys in a region. Then set the region signature to be Arithmetic is done in a GF. g hashes keys into GF. The record signature of a non-existing record is zero.

Signature Implementation The verify operations read region signatures. Addressed by the key-space they cover. Locking is done on regions. Store region signatures. Large regions have little storage overhead, small ones have large storage overhead.

Signature Implementation Region signatures prevent phantom records.

Implementation No-Locking Scheme Assumes loosely synchronized clocks. Clocks that are accurate to within a small multiple of average message delay. Transaction acquires a time-stamp at the lowest numbered SDDS bucket it visits. Transaction sends verify / write / vote requests to all servers it visited. Each server votes on whether the transaction should commit. In the usual way. If every server returns a yes vote to the transaction manager, then the transaction commits. Transaction manager sends out the result of the vote.

Discussion Signature scheme interesting if transactions have large calculation times and updates are rare. Signature scheme should be extendible to replicated databases. Size of region can be fit to the scale of the file, so that a region always has about the same number of records. E.g. whenever the LH* split pointer returns to zero, split regions in half.

Discussion Future Work: Performance evaluation