Database design and implementation CMPSCI 645. Lectures 18: Transactions and Concurrency

Similar documents
Lecture 7: Transactions Concurrency Control

Lecture 5: Transactions Concurrency Control. Wednesday October 26 th, 2011

Introduction to Database Systems CSE 444

CSE 444: Database Internals. Lectures Transactions

CSE544 Transac-ons: Concurrency Control. Lectures #5-6 Thursday, January 20, 2011 Tuesday, January 25, 2011

CS 5614: (Big) Data Management Systems. B. Aditya Prakash Lecture #6: Transac/ons 1: Intro. to ACID

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #17: Transac0ons 1: Intro. to ACID

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #17: Transac0ons 2: 2PL and Deadlocks

Concurrency Control CHAPTER 17 SINA MERAJI

Concurrency Control. [R&G] Chapter 17 CS432 1

Concurrency Control. Conflict Serializable Schedules. Example. Chapter 17

L i (A) = transaction T i acquires lock for element A. U i (A) = transaction T i releases lock for element A

Introduction to Data Management CSE 344

Concurrency Control! Snapshot isolation" q How to ensure serializability and recoverability? " q Lock-Based Protocols" q Other Protocols"

CSE 344 MARCH 9 TH TRANSACTIONS

Introduction to Data Management CSE 414

Concurrency Control. Chapter 17. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1

Concurrency Control. R &G - Chapter 19

CSE 444: Database Internals. Lectures 13 Transaction Schedules

Pessimistic v.s. Optimistic. Outline. Timestamps. Timestamps. Timestamps. CSE 444: Database Internals. Main invariant:

Transaction Management and Concurrency Control. Chapter 16, 17

CSE 344 MARCH 5 TH TRANSACTIONS

References. Transaction Management. Database Administration and Tuning 2012/2013. Chpt 14 Silberchatz Chpt 16 Raghu

CSE 344 MARCH 25 TH ISOLATION

CAS CS 460/660 Introduction to Database Systems. Transactions and Concurrency Control 1.1

Transaction Management: Concurrency Control

Chapter 6 Distributed Concurrency Control

Transactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9

Lecture 5: Transactions in SQL. Tuesday, February 6, 2007

Goal of Concurrency Control. Concurrency Control. Example. Solution 1. Solution 2. Solution 3

Intro to Transactions

Database Systems CSE 414

Introduction to Data Management CSE 344

Concurrency Control & Recovery

Introduction to Data Management CSE 344

Introduction to Data Management CSE 344

Introduction to Data Management CSE 344

Concurrency Control. Chapter 17. Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke

Transaction Management Overview. Transactions. Concurrency in a DBMS. Chapter 16

Announcements. Transaction. Motivating Example. Motivating Example. Transactions. CSE 444: Database Internals

Announcements. Motivating Example. Transaction ROLLBACK. Motivating Example. CSE 444: Database Internals. Lab 2 extended until Monday

Transaction Management Overview

Database Management Systems CSEP 544. Lecture 9: Transactions and Recovery

Overview of Transaction Management

Concurrency Control & Recovery

Transaction Overview and Concurrency Control

Implementing Isolation

Concurrency control 12/1/17

Transaction Processing: Concurrency Control ACID. Transaction in SQL. CPS 216 Advanced Database Systems. (Implicit beginning of transaction)

Concurrency Control. Chapter 17. Comp 521 Files and Databases Fall

Transaction Management & Concurrency Control. CS 377: Database Systems

Concurrency Control. Transaction Management. Lost Update Problem. Need for Concurrency Control. Concurrency control

Conflict Equivalent. Conflict Serializability. Example 1. Precedence Graph Test Every conflict serializable schedule is serializable

Transac.on Management. Transac.ons. CISC437/637, Lecture #16 Ben Cartere?e

Concurrency Control. Chapter 17. Comp 521 Files and Databases Spring

Why Transac'ons? Database systems are normally being accessed by many users or processes at the same 'me.

Database Systems CSE 414

DB2 Lecture 10 Concurrency Control

CMSC 424 Database design Lecture 22 Concurrency/recovery. Mihai Pop

Page 1. CS194-3/CS16x Introduction to Systems. Lecture 8. Database concurrency control, Serializability, conflict serializability, 2PL and strict 2PL

Review. Review. Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Lecture #21: Concurrency Control (R&G ch.

Transaction Processing: Concurrency Control. Announcements (April 26) Transactions. CPS 216 Advanced Database Systems

Intro to Transaction Management

Including Aborts in Serializability. Conflict Serializable Schedules. Recall Conflicts. Conflict Equivalent

Chapter 22. Transaction Management

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636)

CSEP 544: Lecture 07. Transactions Part 2: Concurrency Control. CSEP544 - Fall

Database transactions

Transaction Management: Introduction (Chap. 16)

Database Systems. Announcement

CSE 344 MARCH 21 ST TRANSACTIONS

Page 1. Goals of Today s Lecture" Two Key Questions" Goals of Transaction Scheduling"

Page 1. Goals of Todayʼs Lecture" Two Key Questions" Goals of Transaction Scheduling"

Introduction to Transaction Management

CS 5614: Transaction Processing 121. Transaction = Unit of Work Recall ACID Properties (from Module 1)

Optimistic Concurrency Control. April 13, 2017

Transactions and Concurrency Control

Graph-based protocols are an alternative to two-phase locking Impose a partial ordering on the set D = {d 1, d 2,..., d h } of all data items.

Chapter 13 : Concurrency Control

Optimistic Concurrency Control. April 18, 2018

Database Management Systems 2010/11

Introduction TRANSACTIONS & CONCURRENCY CONTROL. Transactions. Concurrency

5/17/17. Announcements. Review: Transactions. Outline. Review: TXNs in SQL. Review: ACID. Database Systems CSE 414.

2 nd Semester 2009/2010

Database Systems CSE 414

Database Management System

Overview. Introduction to Transaction Management ACID. Transactions

Introduction to Data Management. Lecture #18 (Transactions)

Motivating Example. Motivating Example. Transaction ROLLBACK. Transactions. CSE 444: Database Internals

Page 1. Goals of Today s Lecture. The ACID properties of Transactions. Transactions

h p:// Authors: Tomáš Skopal, Irena Holubová Lecturer: Mar n Svoboda, mar

T ransaction Management 4/23/2018 1

Multi-User-Synchronization

Lock Granularity and Consistency Levels (Lecture 7, cs262a) Ali Ghodsi and Ion Stoica, UC Berkeley February 7, 2018

Chapter 15 : Concurrency Control

Slides Courtesy of R. Ramakrishnan and J. Gehrke 2. v Concurrent execution of queries for improved performance.

Final Review. May 9, 2017

Final Review. May 9, 2018 May 11, 2018

Concurrency Control. Data Base Management Systems. Inherently Concurrent Systems: The requirements

Concurrency Control. Concurrency Control Ensures interleaving of operations amongst concurrent transactions result in serializable schedules

Transcription:

Database design and implementation CMPSCI 645 Lectures 18: Transactions and Concurrency 1

DBMS architecture Query Parser Query Rewriter Query Op=mizer Query Executor Lock Manager Concurrency Control Access Methods Buffer Manager Log Manager Recovery Disk Space Manager DB 2

$233 per person 2 seats lei at this price $233 per person 2 seats lei at this price Book now! Book now! Who will get the =ckets? 3

Solution? } Don t allow mul=ple people / programs access the same data } Problem: things can get slow } Concurrent execu=on } Good performance } But, we need to make sure that no bad things happen Topic: How to allow concurrency 4

How to allow concurrency 1. Which schedules are OK? Serializability Conflict-serializability View-serializability 2. How do we make sure we get OK schedules? Locking Op=mis=c concurrency control 5

Transactions } User programs may do many things on the data retrieved. } E.g., opera=ons on Bob s bank account. } E.g. transfer of money from account A to account B. } E.g., search for a =cket, think about it, and buy it. } But the DBMS is only concerned about what data is read from/wri]en to the database. } A transac'on is DBMS s abstract view of a user program, simply, a sequence of reads and writes. DB programs 7

Principles } Atomicity } Either all of the ac=ons of a transac=on are performed, or none at all } Consistency } If each transac=on leaves the database in a consistent state, concurrent transac=ons should result in a consistent state } Isola=on } A transac=on cannot see the effects of other transac=ons } Durability } If a transac=on is successful, its effects persist 10

The problem } Mul=ple transac=ons are running concurrently T1, T2, } They read/write some common elements A1, A2, } How can we prevent unwanted interference? } The SCHEDULER is responsible for that 11

Some famous anomalies } What could go wrong if we didn t have concurrency control: } Dirty reads (including inconsistent reads) } Unrepeatable reads } Lost updates Many other things can go wrong too 12

Dirty reads Write-Read Conflict T 1 : WRITE(A) T 2 : READ(A) T 1 : ABORT 13

Inconsistent read Write-Read Conflict T 1 : A := 20; B := 20; T 1 : WRITE(A) T 1 : WRITE(B) T 2 : READ(A); T 2 : READ(B); 14

Unrepeatable read Read-Write Conflict T 1 : WRITE(A) T 2 : READ(A); T 2 : READ(A); 15

Lost update Write-Write Conflict T 1 : READ(A) T 1 : A := A+5 T 1 : WRITE(A) T 2 : READ(A); T 2 : A := A*1.3 T 2 : WRITE(A); 16

Schedules } Given mul=ple transac=ons } A schedule is a sequence of interleaved ac=ons from all transac=ons 17

Example T1 T2 READ(A, t) READ(A,s) t := t+100 s := s*2 WRITE(A, t) WRITE(A,s) READ(B, t) READ(B,s) t := t+100 s := s*2 WRITE(B,t) WRITE(B,s) 18

A serial schedule T1 READ(A, t) t := t+100 WRITE(A, t) READ(B, t) t := t+100 WRITE(B,t) Serial schedule: (T1,T2) T2 READ(A,s) s := s*2 WRITE(A,s) READ(B,s) s := s*2 WRITE(B,s) A B 25 25 125 125 250 250 19

A serial schedule (version 2) T1 Serial schedule: (T2,T1) READ(A, t) t := t+100 WRITE(A, t) READ(B, t) t := t+100 WRITE(B,t) T2 READ(A,s) s := s*2 WRITE(A,s) READ(B,s) s := s*2 WRITE(B,s) A B 25 25 50 50 150 150 20

Serializable schedule } A schedule is serializable if it is equivalent to a serial schedule A schedule S is serializable, if there is a serial schedule S, such that for every ini=al database state, the effects of S and S are the same 21

A serializable schedule T1 READ(A, t) t := t+100 WRITE(A, t) READ(B, t) t := t+100 WRITE(B,t) No=ce: This is NOT a serial schedule T2 READ(A,s) s := s*2 WRITE(A,s) READ(B,s) s := s*2 WRITE(B,s) A B 25 25 125 250 125 250 22

A non-serializable schedule T1 READ(A, t) t := t+100 WRITE(A, t) READ(B, t) t := t+100 WRITE(B,t) T2 READ(A,s) s := s*2 WRITE(A,s) READ(B,s) s := s*2 WRITE(B,s) A B 25 25 125 250 50 150 23

Transaction semantics Is this serializable? T1 READ(A, t) t := t+100 WRITE(A, t) READ(B, t) t := t+100 WRITE(B,t) T2 READ(A,s) s := s+200 WRITE(A,s) READ(B,s) s := s+200 WRITE(B,s) A B 25 25 125 325 225 325 24

Ignoring details } Serializability is undecidable! } Scheduler should not look at transac=on details } Assume worst case updates } Only care about reads r(a) and writes w(a) } Not the actual values involved 25

Notation ac=ons T 1 : r 1 (A); w 1 (A); r 1 (B); w 1 (B) T 2 : r 2 (A); w 2 (A); r 2 (B); w 2 (B) transac=on schedule r 1 (A); w 1 (A); r 2 (A); w 2 (A); r 1 (B); w 1 (B); r 2 (B); w 2 (B) 26

Conflict serializability Conflicts: Two ac=ons by same transac=on T i : r i (X); w i (Y) Two writes by T i, T j to same element: w i (X); w j (X) Read/write by T i, T j to same element: w i (X); r j (X) r i (X); w j (X) 27

Conflict serializability } Two schedules are conflict equivalent if: } Involve the same ac=ons of the same transac=ons. } Every pair of conflic'ng ac'ons is ordered the same way. } Schedule S is conflict serializable if S is conflict equivalent to some serial schedule. } Given a set of xacts, conflict serializable schedules are a subset of serializable schedules. } There are serializable schedules that can t be detected using conflict serializability. 28

Conflict serializability A schedule is conflict serializable if swapping adjacent non-conflic=ng ac=ons leads to a serial schedule r 1 (A) w 1 (A) r 2 (A) w 2 (A) r 1 (B) w 1 (B) r 2 (B) w 2 (B) 29

The precedence graph test Is a schedule conflict-serializable? Simple test: } Build a graph of all transac=ons T i } Edge from T i to T j if T i makes an ac=on that conflicts with one of T j and comes first } The test: if the graph has no cycles, then it is conflict serializable! 30

Example 1 r 2 (A); r 1 (B); w 2 (A); r 3 (A); w 1 (B); w 3 (A); r 2 (B); w 2 (B) B A 1 2 3 This schedule is conflict-serializable 31

Example 2 r 2 (A); r 1 (B); w 2 (A); r 2 (B); r 3 (A); w 1 (B); w 3 (A); w 2 (B) B 1 A 2 B 3 This schedule is NOT conflict-serializable 32

All schedules Serializable View serializable Conflict serializable Serial 33

View serializability } Schedules S1 and S2 are view equivalent if: } If Ti reads ini'al value of A in S1, then Ti also reads ini=al value of A in S2 } If Ti reads value of A wri8en by Tj in S1, then Ti also reads value of A wri]en by Tj in S2 } If Ti writes final value of A in S1, then Ti also writes final value of A in S2 T1: R(A) W(A) T2: W(A) T3: W(A) T1: R(A),W(A) T2: W(A) T3: W(A) 34

View serializability (contd.) } A schedule is view serializable if it is view equivalent to a serial schedule. } Every conflict serializable schedule is view serializable. } The converse is not true. } Every view serializable schedule that is not conflict serializable contains a blind write. Lost write w 1 (Y); w 2 (Y); w 2 (X); w 1 (X); w 3 (X); w 1 (Y); w 1 (X); w 2 (Y); w 2 (X); w 3 (X); Equivalent, but can t swap 35

Scheduler } The scheduler is the module that schedules the transac=on s ac=ons, ensuring serializability } How? } Locks } Time stamps } Valida=on 36

Locking scheduler Simple idea: } Each element has a unique lock } Each transac=on must first acquire the lock before reading/wri=ng that element } If the lock is taken by another transac=on, then wait } The transac=on must release the lock(s) 37

Notation L i (A) = transac=on T i acquires lock for element A U i (A) = transac=on T i releases lock for element A 38

Example T1 L 1 (A); READ(A, t) t := t+100 WRITE(A, t); U 1 (A); L 1 (B) READ(B, t) t := t+100 WRITE(B,t); U 1 (B); T2 L 2 (A); READ(A,s) s := s*2 WRITE(A,s); U 2 (A); L 2 (B); DENIED GRANTED; READ(B,s) s := s*2 WRITE(B,s); U 2 (B); Scheduler has ensured a conflict-serializable schedule 39

Example T1 L 1 (A); READ(A, t) t := t+100 WRITE(A, t); U 1 (A) L 1 (B); READ(B, t) t := t+100 WRITE(B,t); U 1 (B); T2 L 2 (A); READ(A,s) s := s*2 WRITE(A,s); U 2 (A); L 2 (B); READ(B,s) s := s*2 WRITE(B,s); U 2 (B); Locks did not enforce conflict serializability!! 40

Two Phase Locking (2PL) The 2PL rule: } In every transac=on, all lock requests must precede all unlock requests } This ensures conflict serializability! (why?) 41

Example: 2PL transactions T1 L 1 (A); L 1 (B); READ(A, t) t := t+100 WRITE(A, t); U 1 (A) READ(B, t) t := t+100 WRITE(B,t); U 1 (B); T2 L 2 (A); READ(A,s) s := s*2 WRITE(A,s); L 2 (B); DENIED GRANTED; READ(B,s) s := s*2 WRITE(B,s); U 2 (A); U 2 (B); Now it is conflict-serializable 42

Example with Abort T1 L 1 (A); L 1 (B); READ(A, t) t := t+100 WRITE(A, t); U 1 (A) READ(B, t) t := t+100 WRITE(B,t); U 1 (B); ABORT T2 L 2 (A); READ(A,s) s := s*2 WRITE(A,s); L 2 (B); DENIED GRANTED; READ(B,s) s := s*2 WRITE(B,s); U 2 (A); U 2 (B); COMMIT 43

What about Aborts? } 2PL enforces conflict-serializable schedules } But what if a transac=on releases its locks and then aborts? } Serializable schedule defini=on only considers transac=ons that commit } Relies on assump=ons that aborted transac=ons can be undone completely 44

Strict 2PL } Strict 2PL: All locks held by a transac=on are released when the transac=on is completed } Ensures that schedules are recoverable } Transac=ons commit only aier all transac=ons whose changes they read also commit } Avoids cascading rollbacks locks 2PL locks Strict 2PL 45

The locking scheduler Task 1: Add lock/unlock requests to transac=ons } Examine all READ(A) or WRITE(A) ac=ons } Add appropriate lock requests } Ensure 2PL! 46

The locking scheduler Task 2: Execute the locks accordingly } Lock table: a big, cri=cal data structure in a DBMS! } When a lock is requested, check the lock table } Grant, or add the transac=on to the element s wait list } When a lock is released, re-ac=vate a transac=on from its wait list } When a transac=on aborts, release all its locks } Check for deadlocks occasionally 47

Deadlock } Transac=on T1 waits for a lock held by T2; } But T2 waits for a lock held by T3; } While T3 waits for.... }... }...and T73 waits for a lock held by T1!! } Could be avoided, by ordering all elements, or deadlock detec=on + rollback 48

Deadlock: example Waits-for graph T1 T2 T1 T2 T3 T4 L(A) R(A) L(B) W(B) L(B) L(C) R(C) L(C) L(B) L(A) T4 T3 Deadlock! Most systems do deadlock detec=on 49

Deadlock prevention T i requests a lock conflic=ng with T j } Wait-die: } If T i has higher priority, it waits; otherwise it is aborted } Wound-wait: } If T i has higher priority, abort T j ; otherwise T i waits Conserva=ve 2PL } Acquire all locks at the beginning 50

Types of locks } Intui=on: it s ok for many Xacts to read the same element. } Shared lock (S) for reads } Exclusive lock (X) for writes } Update lock (U) ini=ally S, possibly later upgrade to X Mode X S U X No No No S No Yes Yes U No Yes No 51

Granularity of locks } Mul=ple Granularity Locking } Allows locking of different size objects (files, pages, records) DB files pages records 52

Granularity of locks } Inten=on Locks: IS, IX, SIX } Lock with appropriate inten=on locks top down. } Release bo]om-up IS Place top-down IS locks DB IS S Want to get S on this page 53

Granularity of locks Mode IS IX S SIX X IS Yes Yes Yes Yes No IX Yes Yes No No No S Yes No Yes No No SIX Yes No No No No X No No No No No 54

The phantom problem } We ve been looking at updates } What about inser=ons/dele=ons? T1: select count(*) from R where price>20................ select count(*) from R where price>20 T2:........ insert into R(name,price) values( Gizmo, 50).... Solu=ons: Coarse locks (table level) Predicate locking (index locking) Aha! Phantom tuple! 55

Beyond locking } Op=mis=c Concurrency Control } Intui=on: } There is overhead in locking, so if we don t expect may conflicts, we can sort of wing it and hope for the best J 56

Timestamps } Each transac=on receives a unique =mestamp TS(T) } Could be: } The system s clock } A unique counter, incremented by the scheduler 57

Timestamps Main invariant: The =mestamp order defines the serializa=on order of the transac=on 58

Main idea } For any two conflic=ng ac=ons, ensure that their order is the serialized order: } In each of these cases } W T1 (X)... R T2 (X) } R T1 (X)... W T2 (X) } W T1 (X)... W T2 (X) Possible conflicts } Answer: Check that TS(T1) < TS(T2) When T2 wants to read X, r T2 (X), how do we know T1, and TS(T1)? 59

Timestamps With each element X, associate: } RT(X) = the highest =mestamp of any transac=on that read X } WT(X) = the highest =mestamp of any transac=on that wrote X } C(X) = the commit bit: true when transac=on with highest =mestamp that wrote X commi]ed If 1 element = 1 page, these are associated with each page X in the buffer pool 60

Time-based scheduling Note: simple version that ignores the commit bit } Transac=on wants to read element X } If TS(T) < WT(X) abort } Else read and update RT(X) to larger of TS(T) or RT(X) } Transac=on wants to write element X } If TS(T) < RT(X) abort } Else if TS(T) < WT(X) ignore write & con=nue (Thomas Write Rule) } Otherwise, write X and update WT(X) to TS(T) 61

Details Read too late: } T1 wants to read X, and TS(T1) < WT(X) START(T1) START(T2) W T2 (X)... R T1 (X) Need to rollback T1! 62

Details Write too late: } T1 wants to write X, and TS(T1) < RT(X) START(T1) START(T2) R T2 (X)... W T1 (X) Need to rollback T1! 63

Details Write too late, but we can s=ll handle it: } T1 wants to write X, and TS(T1) RT(X) but WT(X) > TS(T1) START(T1) START(T2) W T2 (X)... W T1 (X) Don t write X at all! 64

More problems Read dirty data: } T2 wants to read X, and WT(X) < TS(T2) } Seems OK, but START(T1) START(T2) W T1 (X)... R T2 (X) ABORT(T1) If C(X)=false, T2 needs to wait for it to become true 65

More problems Write dirty data: } T1 wants to write X, and WT(X) > TS(T1) } Seems OK not to write at all, but START(T1) START(T2) W T2 (X)... W T1 (X) ABORT(T2) If C(X)=false, T1 needs to wait for it to become true 66

Timestamp-based scheduling } When a transac=on T requests R(X) or W(X), the scheduler examines RT(X), WT(X), C(X), and decides one of: } To grant the request, or } To rollback T (and restart) With what =mestamp? } To delay T un=l C(X) = true 67

Tradeoffs } Locks: } Great when there are many conflicts } Poor when there are few conflicts } Timestamps } Poor when there are many conflicts (rollbacks) } Great when there are few conflicts } Compromise } READ ONLY transac=ons =mestamps } READ/WRITE transac=ons locks 70

Concurrency Control by Validation Kung-Robinson Model } Each transac=on T defines a read set RS(T) and a write set WS(T) } Each transac=on proceeds in three phases: } Read all elements in RS(T). Time = START(T) } Validate (may need to rollback). Time = VAL(T) } Write all elements in WS(T). Time = FIN(T) Main invariant: the serializa=on order is VAL(T) Ti Read Validate Write 71

Test 1 } For all i and j such that Ti < Tj, check that Ti completes before Tj begins. Ti R V W Tj R V W

If Test 1 fails, try Test 2 } For all i and j such that Ti < Tj, check that: } Ti completes before Tj begins its Write phase, and } WriteSet(Ti) ReadSet(Tj) is empty. Ti R V W R V W Tj Does Tj read dirty data? Does Tj overwrite Ti s writes? v Check correctness: all three types of conflicts, W-R, R- W, W-W, if present, go one way only.

If Test 2 fails, try Test 3 } For all i and j such that Ti < Tj, check that: } Ti completes Read phase before Tj does, and } WriteSet(Ti) ReadSet(Tj) is empty, and } WriteSet(Ti) WriteSet(Tj) is empty. Ti R V W R V W Tj Does Tj read dirty data? Does Tj overwrite Ti s writes? v Why is it correct?

Comments on Optimistic CC } Compared to Locking } Op=mis=c CC: assumes no conflicts first, only fixes problems when conflicts appear, by restar'ng xacts. } Locking (pessimis=c): conflicts are prevented in advance, by blocking from (poten=ally) nonserializable ac=ons. } Works well for some workloads: } All xacts are readers. } Low interference, e.g. large amount of data, each xact accessing a small (likely non-overlapping) amount of data. } Deadlock free, but may have starva=on. } No phantom problem!

Overheads in Optimistic CC } Record read/write ac=vity in ReadSet/WriteSet per Xact. } Must create and destroy these sets as needed. } Check for conflicts during valida=on } Code for valida=on is in a cri=cal sec=on, and cri=cal sec=on can reduce concurrency. } Make validated writes global. } Scheme for making writes global can reduce clustering of objects. Sequen=al I/O is unlikely later. } Restart Xacts that fail valida=on. } Work done so far is wasted; requires clean-up. } Starva=on may occur.