1 / 12

Concurrency Control by Validation (18.9)

Concurrency Control by Validation (18.9). By: Pushkar Marathe Id: 217. Agenda. Overview Architecture of the scheduler Validation rules Example Comparison of concurrency control mechanisms. Overview. Type of optimistic concurrency control.

Download Presentation

Concurrency Control by Validation (18.9)

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(18.9) By: Pushkar Marathe Id: 217

  2. Agenda • Overview • Architecture of the scheduler • Validation rules • Example • Comparison of concurrency control mechanisms

  3. Overview • Type of optimistic concurrency control. • Scheduler keeps a record of transactions rather than timestamps. • Validation phase before writing values into database.

  4. Architecture • Scheduler should know the read and write sets for each transaction. • Three phases of transactions: • Read: Reads from database to read set. • Validate: Validates by comparing the read and write sets with other transactions. • Write: Writes from write set to database. • Serial order is maintained based on which the scheduler decides whether to validate or not.

  5. To support the decision of validating three sets are maintained: • START: Set of all active transactions that are not validated. • VAL: Set of all transactions that are validated and are still active. • FIN: Set of all transactions that have finished execution. For these the scheduler records START(T),VAL(T),FIN(T).

  6. T reads X U writes X T start T validating U start U validated Validation Rules • Suppose there is a transaction U such that: • 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(U) is not empty; in particular, let it contain database element X. Figure 1

  7. Here it is possible that U writes X after T reads X. to make sure that T got to read U’s value we need to rollback T to avoid a risk that the actions of T and U will be consistent with the serial order.

  8. T reads X U writes X T validating U finish U validating • Suppose there is a transaction U such that: • 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(U) is not empty; in particular, let it contain database element X.

  9. T and U both write values of X and if we validate T then it will write X before U. Here also we rollback T so that order is not violated.

  10. Comparison of three concurrency-control Mechanisms Storage Utilization • Locks : Space in lock table proportional to number of database elements locked • Timestamps : Space proportional to database elements that have been accessed recently. • Validation : Space proportional to currently active transactions and some transactions that finished just some time before the current started.

  11. We can also compare based on ability of transactions to complete without delay. • Locking delays transactions but avoids rollback. • If interface is low, then neither timestamps nor validations will cause rollbacks. • When rollback necessary timestamps can catch problems earlier than validation.

  12. THANK YOU

More Related