Robustness against Parallel Snapshot Isolation Giovanni Bernardi - - PowerPoint PPT Presentation

robustness against parallel snapshot isolation
SMART_READER_LITE
LIVE PREVIEW

Robustness against Parallel Snapshot Isolation Giovanni Bernardi - - PowerPoint PPT Presentation

Robustness against Parallel Snapshot Isolation Giovanni Bernardi jointly with Andrea Cerone Alexey Gotsman 1 / 22 strong consistency weak consistency Eventual Consistency, Sequential DB Causal Consistency, Parallel Snapshot Isolation


slide-1
SLIDE 1

Robustness against Parallel Snapshot Isolation

Giovanni Bernardi

jointly with

Andrea Cerone Alexey Gotsman

1 / 22

slide-2
SLIDE 2

strong consistency

Sequential DB High Latency

weak consistency

Eventual Consistency, Causal Consistency, Parallel Snapshot Isolation

Low Latency

2 / 22

slide-3
SLIDE 3

P = wr(y, 1) txn{rd(x); rd(y)} wr(x, 1)

Sequential DB

3 / 22

slide-4
SLIDE 4

P = wr(y, 1) txn{rd(x); rd(y)} wr(x, 1) wr x 1 wr y 1

Sequential DB

4 / 22

slide-5
SLIDE 5

P = wr(y, 1) txn{rd(x); rd(y)} wr(x, 1) wr x 1 wr y 1

Sequential DB

5 / 22

slide-6
SLIDE 6

P = wr(y, 1) txn{rd(x); rd(y)} wr(x, 1) wr x 1 wr y 1 rd x 1; rd y 0 rd x 0; rd y 1

Sequential DB

6 / 22

slide-7
SLIDE 7

Robustness against psi

behaviours of P behaviours of P ?

=

psi sc

7 / 22

slide-8
SLIDE 8

Definition psi: TransHB + Ext + NoConflict

Transactions: R, S, T, . . .

T wr (m, z) T rd (n, y)

Histories: H, H′, . . .

H = {T1, T2, T3, T4}, finite

(H, hb)

8 / 22

slide-9
SLIDE 9

Definition psi: TransHB + Ext + NoConflict

Transactions: R, S, T, . . .

T wr (m, z) T rd (n, y)

Histories: H, H′, . . .

H = {T1, T2, T3, T4}, finite

(H, hb)

∀R, S, T ∈ H. R hb S and S hb T ⇒ R hb T

rd y 1; wr x 1 wr y 1 rd x 1; rd y 1

hb hb hb

9 / 22

causal message delivery

slide-10
SLIDE 10

Definition psi: TransHB + Ext + NoConflict

Transactions: R, S, T, . . .

T wr (m, z) T rd (n, y)

Histories: H, H′, . . .

H = {T1, T2, T3, T4}, finite

(H, hb)

∀T ∈ H.T rd (x, n) ⇒ lastwrite(x, T, hb) wr (x, n) . . .

rd y 1; wr x 1 wr y 1 rd x 1; rd y 1

hb hb hb

10 / 22

reads return value written last according to hb

  • r default initial
slide-11
SLIDE 11

Definition psi: TransHB + Ext + NoConflict

Transactions: R, S, T, . . .

T wr (m, z) T rd (n, y)

Histories: H, H′, . . .

H = {T1, T2, T3, T4}, finite

(H, hb)

∀S, T ∈ H.T, S wr (x, ) =

⇒ S = T or S hb T or T hb S

wr x 3 wr x 5

hb

11 / 22

write-write conflict detection

slide-12
SLIDE 12

Definition sc: TransHB + Ext + TotalHB

Transactions: R, S, T, . . .

T wr (m, z) T rd (n, y)

Histories: H, H′, . . .

H = {T1, T2, T3, T4}, finite

(H, hb)

∀S, T ∈ H.

S = T or S hb T or T hb S

wr y 5 wr x 3 rd z 0 rd y 5; wr z 7

hb hb hb hb hb hb

12 / 22

serial execution

slide-13
SLIDE 13

Robustness against psi

behaviours of P behaviours of P ?

=

psi sc Idea: define φ s.t.

∀(H, hb) ∈ psi.φ(H, hb) implies ∃ hb′ .(H, hb′) ∈ sc

easy

show a total hb′ over H s.t.

hard

reads return values written last according to hb′

13 / 22

slide-14
SLIDE 14

Dynamic dependency graph

◮ T overwrites value written by S on x

S hb T

S T ww, x

◮ T reads the value written by S on x

S hb T

S T wr, x

◮ S overwrites a value read by T

R S T wr, x ww, x rw, x wr x, 1 rd x, 0 rw, x

14 / 22

function

DDG(H, hb) = (H,

λ

− →)

slide-15
SLIDE 15

Dynamic dependency graph

◮ T overwrites value written by S on x

S T ww, x

◮ T reads the value written by S on x

S T wr, x

◮ S overwrites a value read by T

R S T wr, x ww, x rw, x wr x, 1 rd x, 0 rw, x

15 / 22

function

DDG(H, hb) = (H,

λ

− →)

wr x 1 wr y 1 rd x 1; rd y 0 rd x 0; rd y 1

hb hb

rw edges ⇒ DDG(H, hb) may contain cycles

slide-16
SLIDE 16

Dynamic dependency graph

◮ T overwrites value written by S on x

S T ww, x

◮ T reads the value written by S on x

S T wr, x

◮ S overwrites a value read by T

R S T wr, x ww, x rw, x wr x, 1 rd x, 0 rw, x

16 / 22

function

DDG(H, hb) = (H,

λ

− →)

wr x 1 wr y 1 rd x 1; rd y 0 rd x 0; rd y 1

wr, x wr, y rw, x rw, y

rw edges ⇒ DDG(H, hb) may contain cycles

slide-17
SLIDE 17

Robustness against psi

behaviours of P behaviours of P ?

=

psi sc

∀(H, hb) ∈ psi.

  • 1. if acyclic(DDG(H, hb)) then ∃ hb′ .(H, hb′) ∈ sc
  • 2. if ∃ total po hb′ . hb′ contains edges DDG(H, hb) then

reads return values written last according to hb′

  • r default initial

17 / 22

slide-18
SLIDE 18

Robustness against psi

behaviours of P behaviours of P ?

=

psi sc

∀(H, hb) ∈ psi.

  • 1. if acyclic(DDG(H, hb)) then ∃ hb′ .(H, hb′) ∈ sc
  • 2. if ∃ total po hb′ . hb′ contains edges DDG(H, hb) then

reads return values written last according to hb′

  • r default initial

As it is, useless for static analysis!

18 / 22

slide-19
SLIDE 19

Robustness criterion Cycle π in DDG(H, hb) PSI-critical if

◮ π contains

S

rw, x

− − − → T, S′

rw, y

− − − → T ′

◮ x = y

for all (H, hb) ∈ psi

no critical cycles in DDG(H, hb)

implies

∃ hb′ . (H, hb′) ∈ sc

19 / 22

slide-20
SLIDE 20

wr x 1 wr y 1 rd x 1; rd y 0 rd x 0; rd y 1 wr, x wr, y rw, x rw, y

20 / 22

slide-21
SLIDE 21

in this talk

First robustness criterion for psi

  • n going work

Reasoning techniques for geo-replicated DBs

◮ Uniform axiomatisation weak consistency levels

Paper to appear at CONCUR’15

◮ Systematic investigation robustness/chopping

First chopping criterion for si

ask Andrea

◮ Checking robustness of applications against psi

TPC-C, RUBiS, . . .

21 / 22

slide-22
SLIDE 22

That’s the story. Thank you :-) Questions?

22 / 22