Strong Invariants for Weak Consistency
Gustavo Petri Marc Shapiro Masoud Saeida-Ardekani
Strong Invariants for Weak Consistency Gustavo Petri Marc Shapiro - - PowerPoint PPT Presentation
Strong Invariants for Weak Consistency Gustavo Petri Marc Shapiro Masoud Saeida-Ardekani Consistency & Invariants Consistency in 3D Characterization of consistency models according to the guarantees they provide Dimensions of
Gustavo Petri Marc Shapiro Masoud Saeida-Ardekani
according to the guarantees they provide
Which invariants are guaranteed by the consistency model without additional instrumentation?
[Decomposing consistency]
4
…of invariant … of protocol Gen1 Constrain value of an
Total order of
PO Ordering between
Visibility EQ State equivalence between objects Composition
Total Order Axis (Gen1)
How Operations on Individual Objects are Updated/Observed
Partial Order Axis (PO)
How Operations on Different Objects are Updated/Observed
Equality Axis (EQ)
How Composed Operations on Different Objects are Updated/Observed
{ 0 ≤ balance ≤ MAXINT }
{ x ≤ y }
{ x ∈ friendsOf(y) ⇐ ⇒ y ∈ friendsOf(x) }
u: state ⤻ (retval, (state ⤻ state)) Prepare (@origin) u?; deliver u! Read one, write all (ROWA) Deferred-update replication (DUR)
replica
u! u! u?
client
u
replica
uPRE
Concurrent, Multi-master Strong: total order, identical state Weak: concurrent, interleaving, no global state
v? v! v! u! u! u?
Axiomatic definitions can be derived from the operational ones
v? v! v! u! u! u? u! v! u! u? v? v!
v? v! v! u! u! u? u! v! u! v!
in an order consistent with a global total order
(TO)
Concurrent Negotiated total
Total order, capricious Total order updates + queries
⇒ ⇒ ⇒
∼
(TO) (PO)
Concurrent Negotiated total
Total order, capricious Total order updates + queries Monotonic Reads + Read My Writes Total causal order Rollbacks + Write-Read dependence + Session Order External
* Program Order as communication
I = { x y (i. Ai Bi) } x = x + A1; y = y + B1;
y = y + B2;
y = y + B3;
Usual approach: ghost variables
I = { x ( ite(ai, Ai, 0)) y ( ite(si, Bi, 0)) (i. Ai Bi)} x = x + A1; a1 = true;
s1 = true;
a2 = true;
s2 = true;
a3 = true;
s3 = true;
1 ∼ 1
1 1 1
Template Proof for Demarcation-style Programs**
I = { x ( ite(ai, Ai, 0)) y ( ite(si, Bi, 0)) (i. Ai Bi)}
a1 = true;
s1 = true;
a2 = true;
s2 = true;
a3 = true;
s3 = true;
compatible but slightly different]
(TO) (PO) (EQ)
Concurrent Negotiated total
Total order, capricious Total order updates + queries Monotonic Reads + Read My Writes Total causal order Rollbacks + Write-Read dependence + Session Order External I n d i v i s i b l e e f f e c t s + s n a p s h
+ c
s i s t e n t s n a p s h
S i n g l e
e r a t i
⇒
and the invariant
CRDTs?