Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee,...

15
Classification of Weak Correctness Criteria for Real-Time Database Ap plications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea

Transcript of Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee,...

Page 1: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Classification of Weak Correctness Criteria for Real-Time Database Applications

1996. 8. 21Lee, Kyu-Woong and Park, Seog

Sogang Univ., Seoul, Korea

Page 2: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Contents Introduction and Motivation Forms of Database Consistency VSR and Relaxed Serializability Statewise Serializability(SSR) Algorithm for SSR Comparisons to Other Criteria Conclusion

Page 3: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Introductory Example the example

– that the final state of schedule H0 is correct with respect to the situation in the real world

x y z

T1 W

T2 R W

T3 W R

T1 W

time 0

time 1

time 3

time 5

time 10

schedule H0 : W1(x) R2(x) W2(x) R3(z) W3(y) W1(y)

But, the final state is the same as the serial schedule T3T1T2

At this time, one oftransactions should be

aborted to satisfythe conflict serializability.

Page 4: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Forms of Database Consistency

strong consistency

weak consistency

update consistency

write consistency

state consistency

strict consistency

Page 5: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Forms of Database Consistency weak consistency[GW82]

multiple query cycles are allowed

update consistency[BC92] single query cycles are allowed

if they can be broken by removingthe single read-write edge betweenupdate transactions

U1

U3

Q2 Q4

U2 U3

Q1

single read-write edge

Page 6: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

write consistency single query cycles are allowed update transaction cycles are not allowed Epsilon-serializability [WYP92]

state consistency update transaction cycle are restrictively allowed

Forms of Database Consistency

U1

Q2

U1 U2

U3

write-write

Page 7: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Motivation

VSR

possibility– All of non-VSR schedule produce the inconsistent state ? – It is possible that the non-view serializable schedules produ

ce a correct(consistent) state

CSR

serial correct states

possible range of relaxed serializability

Page 8: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

View Serializability[BH 87]

A schedule H is said to be view-serializable if it is view-equivalent to some serial schedule

Two schedules H1 and H2 are view equivalent

1. They are over the same set of transactions and same set of operations

2. for any data item x, if Ti reads x from Tj in H1, then Ti reads x from Tj in H2.

3. for each data item x, if the write operation Wi(x) is the final write of x in H1, then it is also the final write of x in H2.

Page 9: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

the schedules that producethe correctstates(the same finalwrite)

The Range of Relaxed SR

CSR

VSR

all possible schedules

: final states are consistent

: final states are inconsistent

schedules thathave the same

read-from relationshipsas some serial schedule

Page 10: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Invalid Read Operation invalid read operation

– A read operation Rinvalid in the schedule H is invalid iff

• Rinvalid is different from the read-from relationship of a serial schedule that produces the same database state as the result of schedule H.

example of invalid read operation– schedule H1 : W1(a) R2(a) W2(b) W3(b) W3(c) R1(c)

a b c

T1 W

T2 R W

T3 W W

T1 R

an invalid read operation

final state of schedule H1 is the same as the serial schedule T1T2T3

Page 11: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Statewise Serializability [definition]

A schedule is statewise serializable if and only if(1) A schedule has the same result as at least one serial sche

dule and(2) If there exists invalid read operations Rinvalid,

they do not reflect any changes on the database state

problem– How can we find the invalid read operations ?– NP problem

Page 12: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Algorithm for Relaxed SR data structures

– Wedge : the set of write-write conflict edges

– Wseti : the set of data item that is written by T i

algorithm

Tj

Ti

Ti+1

Tk

Tk-1

W

W

Wseti ⊇ Wset

j

Page 13: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Example of Proposed Algorithm

schedule H2 : W1(a) R2(a) W2(b) R3(b) W3(c) W1(c)

a b c

T1 W

T2 R W

T3 R W

T1 W

final state is the same as a serial schedule T3T1T2

T1

T2 T3

wR

w

ww

R

the set of write data item Wset1: { a, c}

the set of write data item Wset3: { c}

Page 14: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

SSR(statewise serializability)

VSR

CSR

Comparison to Other Criteria

serial

Page 15: Classification of Weak Correctness Criteria for Real-Time Database Applications 1996. 8. 21 Lee, Kyu-Woong and Park, Seog Sogang Univ., Seoul, Korea.

Conclusion our contribution for real-time database system

– provides the higher degree of concurrency– reduces the abort ratio of transaction with urgent deadline– utilizes for other application with semantic transaction

further research– extendibility for applying the relaxed serializability to distribute

d database system