Distributed Optimistic Algorithm

Slides:



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

Database Systems (資料庫系統)
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.
Concurrency Control II
Concurrency Control II. General Overview Relational model - SQL  Formal & commercial query languages Functional Dependencies Normalization Physical Design.
Concurrency Control Nate Nystrom CS 632 February 6, 2001.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Transaction Management and Concurrency Control
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
Transaction Management and Concurrency Control
Transaction Management and Concurrency Control
Optimistic CC Performance Evaluation Criterion 1. Degree of Concurrency Less reshuffle  High degree of concurrency 2. Resources used to recognize - Lock.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Session - 14 CONCURRENCY CONTROL CONCURRENCY TECHNIQUES Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 8-1 COS 346 Day 18.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Academic Year 2014 Spring Academic Year 2014 Spring.
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
AN OPTIMISTIC CONCURRENCY CONTROL ALGORITHM FOR MOBILE AD-HOC NETWORK DATABASES Brendan Walker.
Concurrency Control in Distributed Databases. By :- Rishikesh Mandvikar rmandvik[at]engr.smu.edu May 1, 2004.
Distributed DBMSSlide 1Lectured by, Jesmin Akhter, Assistant Professor, IIT, JU PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor,
Formal-Concurrency-Control General Comments Information needed by Concurrency Controllers –Locks on database objects (System-R, Ingres, Rosenkrantz…) –Time.
Lecture 12 Recoverability and failure. 2 Optimistic Techniques Based on assumption that conflict is rare and more efficient to let transactions proceed.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
Transactions. What is it? Transaction - a logical unit of database processing Motivation - want consistent change of state in data Transactions developed.
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.
Optimistic Methods for Concurrency Control By: H.T. Kung and John Robinson Presented by: Frederick Ramirez.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
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 :
Computer Science Lecture 13, page 1 CS677: Distributed OS Last Class: Canonical Problems Election algorithms –Bully algorithm –Ring algorithm Distributed.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Concurrency control.
Last Class: Canonical Problems
Transaction Management and Concurrency Control
Concurrency Control.
Part- A Transaction Management
General Comments Information needed by Concurrency Controllers
Transaction Management Transparencies
Outline Introduction Background Distributed DBMS Architecture
4. Concurrency control techniques
Outline Introduction Background Distributed DBMS Architecture
Concurrency Control II (OCC, MVCC)
Database Processing: David M. Kroenke’s Chapter Nine: Part One
Lecture 17: Transactional Memories I
Chapter 10 Transaction Management and Concurrency Control
Concurrency Control Chapter 17
Outline Introduction Background Distributed DBMS Architecture
Lecture 21: Concurrency & Locking
CS162 Operating Systems and Systems Programming Review (II)
Chapter 15 : Concurrency Control
Distributed Database Management Systems
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Distributed Transactions
Atomic Commit and Concurrency Control
Concurrency Control Chapter 17
Lecture 22: Intro to Transactions & Logging IV
Transaction management
Concurrency control (OCC and MVCC)
Database Systems (資料庫系統)
Optimistic CC Performance
Outline Introduction Background Distributed DBMS Architecture
Outline Introduction Background Distributed DBMS Architecture
Transactions, Properties of Transactions
Presentation transcript:

Distributed Optimistic Algorithm Assumptions Synchronized clocks MTD (max, trans, delay) can be defined Step 1: Read Step 2: Compute Step 3: transaction is broadcasted to all nodes at time (Vi) (time when computation finishes and Ti is ready for validation) Step 4: At time (Vi) + MTD, all nodes start validation of Ti. (Note (Vi) is attached to Ti) and if Ti reaches before (Vi) + MTD, it must wait Optimistic-CC

Step 5: If validation succeeds, all nodes write S(wi) ELSE all nodes except “X” ignore Ti At node X, Ti is restarted and repeated until Ti validates THEOREM: The dist. opt. algorithm produces only correct histories at each node and all histories are identical PROOF: ONLY correct histories are produced. Because of Theorem 1 ELSE UPDATE S(Ri) and repeat from step 2 Optimistic-CC

Centralized Optimistic Algorithm: A node(C) is chosen as central node CASE 1: Validation takes place only at central node When Ti arrives at a node “X” Read S(Ri) Execute (compute) and get S(wi) Note S(wi) is semantic write set (actual) Locking may require syntactic (potential) write set S'(wi) S(wi) leq S'(wi) Ti goes to node C (if X  C) If Ti succeeds, send write set to all nodes Optimistic-CC

CASE 2: Validation takes place at local node and then at central node Same Ti validates at X If successful, Ti commits at X and is sent to C ELSE UPDATE S(Ri) and repeat from step 2 If successful at C, send write set to all nodes ELSE UPDATE S(Ri) at C and execute at C and repeat validation until successful. Optimistic-CC

Centralized Optimistic CASE 1: Validation takes place only at central node only CASE 2: Validation takes place at local node and then central node Distributed Optimistic Validation takes place at all nodes after a delay of MTD (Max. transmission Delay) Optimistic-CC

When to synchronize (assert concurrency control) First access to an entity (locking, pessimistic validation) At each access (granularity level) After all accesses and before commitment (optimistic validation) Optimistic-CC

Information needed for synchronization Locks on database entities (system R, INGRES, Rosenkrantz,…) Time stamps on database entities (Thomas, Reed,…) Time stamps on transactions (Kung, SDD-1, Schlageter,…) OBSERVATIONS - Time stamps more fundamental than locking - Time stamps carry more information - Time stamp checking costs more than checking locks Optimistic-CC

So given interpretation of fij’s allows us to include histories T11: X ← X + 1 T21: X ← X + 1 T12: X ← 2 * X History Serial T1 T2 or T2 T1  f12(f11(f21(x)))  f21(f12(f11(x))) f: Herbrand fn. non serializable T11, T21, T12 f12(f21(f11(x))) So given interpretation of fij’s allows us to include histories which are not allowed by SERIALIZABILITY and hence allows us higher concurrency Optimistic-CC

Figure 2 I/O Obtain S(Ri) Optimistic-CC Local Validation Successful? Send transaction to other sites Trans- action (Ti) arrives From TM' I/O Q (Lo) Read S(Ri) Write S(Wi) Transaction (Ti) Finishes I/O Q (Hi) Execute S(Wi) and Validate CPU No Yes Global CPUQ Figure 2 Optimistic-CC

Locking Mechanism (Pessimistic) C.P.U. Obtain S(Ri) S(Wi) Locks granted Obtain locks from lock table for S(Ri) and Execute Release locks CPUQ (med) CPUQ (Hi) CPUQ (low) No Yes Arrive IOQ (Hi) Write S(Wi) Read S(Ri) I/O Done Locking Mechanism (Pessimistic) Optimistic-CC

Steps of a Transaction (Ti) Non-Locking Algorithm The transaction (Ti) arrives in the system The read S'(Ri) and write S'(Wi) set of the transaction is obtained. These sets are syntactic The transaction goes to an I/O queue to obtain item values for read set S‘(Ri) The transaction goes to CPU queue and completes execution to obtain write set values. Also actual read set S(Ri) and write set S(wi) are determined. These sets represent semantic information The transaction’s read sets are validated against other active transactions according consistency constraints (such as serializability) Optimistic-CC

Steps of a Transaction (Ti) … (continued) If validation fails due to conflict among transaction Ti and some other transaction Tj, then one of the transaction is required to repeat its execution. For example, if consistency constraint is “strongly serializable”, then the transaction that arrived later (let us say Ti) is selected for re-execution. Moreover the conflict among Ti and Tj is resolved and the values of S'(Ri) are updated with values from S(Wj) at the time of validation. This is useful because Ti does not have to go and do its I/O once again. The transaction is sent to CPU queue to do its computation. The transaction Ti’s write set is validated against write set of some transaction Tj (that has not completed but arrived before Ti). If conflict occurs, then Ti is delayed and writes after Tj writes in the database. The transaction goes to an I/O queue and update its write set S(Wi). The transaction Ti waits in memory for validation against transactions that arrived in the interval between its arrival time and validation time. Optimistic-CC

Performance Techniques Complexity Analytical Simulation Empirical Optimistic-CC

Parameters Arrival rate Base set (size of write set/read From Users From Network To users To network I/O server CPO server Performance model at each node Parameters Arrival rate Base set (size of write set/read Size of database Number of sets Transmission delay CPU time I/O time Retry delay Read only trans/write & read trans ratio Multiprogramming level Degree of conflict Optimistic-CC