1 / 10

Concurrency control by validation

Concurrency control by validation. Concurrency control by validation. Architecture of Validation based scheduler The validation rules Comparison of three concurrency-control mechanism Exercises. How can concurrency control be performed with validation?.

stian
Download Presentation

Concurrency control by validation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Concurrency control by validation

  2. Concurrency control by validation • Architecture of Validation based scheduler • The validation rules • Comparison of three concurrency-control mechanism • Exercises

  3. How can concurrency control be performed with validation? • In this method, transactions are allowed to access data without locks. • At the appropriate time a check is performed that the transaction has behaved in a serializable manner. • Just before a transaction starts to write values of database elements, it goes through a “validation phase”. • In this phase the risk of a physically unrealizable behavior is checked, if a risk exists the transaction is rolled back. • The above processes are taken care of, by a validation scheduler.

  4. Validation-Based scheduler • The validation-based scheduler must know the following: * The set of database elements the transaction T reads. * The set of database elements T writes. • T executes in three phases: * Read – elements are read into read set RS(T) and local address space for write is calculated. * Validate – Validation of clashing elements with other transactions is done. * Write – transaction writes elements to write set WS(T)

  5. Validation based Scheduler sets • Validation based scheduler assumed serial order of transactions. • It maintains three sets of transactions: • START( ): set of T’s started but not completed validation. • VAL( ): set of T’s validated but not finished the writing phase. • FIN( ): set of T’s that have finished.

  6. Potential problems with validation scheduler • Case 1: • U is in VAL or FIN; that is, U has validated, • FIN(U)>START(T); that is, U did not finish before T started • RS(T) ∩WS(T) ≠φ; let it contain database element X. Since in this case we don’t know if T got to read the value that U wrote, we must roll back T to avoid the risk that the actions of T and U will not be consistent with the assumed serial order.

  7. Potential problems with validation scheduler • Case 2: - U is in VAL; U has successfully validated. - FIN(U)>VAL(T); U did not finish before T entered its validation phase. - WS(T) ∩ WS(U) ≠φ; let x be in both write sets. T and U must both write values of X and if we let T validate, it is possible that it will write X before U does. Since we cannot be sure, we rollback T to make sure it does not violate the assumed serial order in which it follows U.

  8. Sample Problem

  9. Solution • Validation of U: Nothing to check • Validation of T: WS(U) ∩ RS(T)= {D} ∩{A,B}=φ WS(U) ∩ WS(T)= {D}∩ {A,C}=φ • Validation of V: RS(V) ∩ WS(T)= {B}∩{A,C}=φ WS(V) ∩ WS(T)={D,E}∩ {A,C}=φ RS(V) ∩ WS(U)={B} ∩{D}=φ • Validation of W: RS(W) ∩ WS(T)= {A,D}∩{A,C}={A} RS(W) ∩ WS(V)= {A,D}∩{D,E}={D} WS(W) ∩ WS(V)= {A,C}∩{D,E}=φ (W is not validated)

  10. Thank You

More Related