Strong Invariants for Weak Consistency Gustavo Petri Marc Shapiro - - PowerPoint PPT Presentation

strong invariants for weak consistency
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Strong Invariants for Weak Consistency

Gustavo Petri Marc Shapiro Masoud Saeida-Ardekani

slide-2
SLIDE 2

Consistency & Invariants

  • Consistency in 3D
  • Characterization of consistency models

according to the guarantees they provide

  • Dimensions of Guarantees
  • Single object
  • Propagation of effects on different objects
  • Composition of objects
slide-3
SLIDE 3

How much can I get for free?

Which invariants are guaranteed by the consistency model without additional instrumentation?

slide-4
SLIDE 4

[Decomposing consistency]

Three classes…

4

…of invariant … of protocol Gen1 Constrain value of an

  • bject

Total order of

  • perations

PO Ordering between

  • perations

Visibility EQ State equivalence between objects Composition

slide-5
SLIDE 5

Consistency in 3D

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) }

slide-6
SLIDE 6

Program Model: Operationally

slide-7
SLIDE 7

Operation

u: state ⤻ (retval, (state ⤻ state)) Prepare (@origin) u?; deliver u! Read one, write all (ROWA) Deferred-update replication (DUR)

  • rigin

replica

u! u! u?

client

u

  • ther

replica

uPRE

slide-8
SLIDE 8

Concurrent

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

slide-9
SLIDE 9

Total Order Axis

  • Assumption: Single Object
  • Total Order of Effectors and Generators (TOE=TOG)

v? v! v! u! u! u? u! v! u! u? v? v!

slide-10
SLIDE 10

Total Order Axis

  • Assumption: Single Object
  • Total Order of Effectors and Generators (TOE1)

v? v! v! u! u! u? u! v! u! v!

slide-11
SLIDE 11

Total Order Axis

  • Assumption: Single Object
  • Total Order of Effectors and Generators (TOE1)
  • Gapless TOE1: all replicas apply all effectors in the same
  • rder
  • Capricious TOE1: replicas apply a subset of the effectors

in an order consistent with a global total order
 
 
 


  • Concurrent Updates (No Global Ordering)

}

slide-12
SLIDE 12

(TO)

Concurrent Negotiated total

  • rder updates

Total order, capricious Total order updates + queries

slide-13
SLIDE 13

Total Order Axis (Gen1)

  • Assumptions:
  • (i) Single Object,
  • (ii) State Based,
  • (iii) O is a valid object for I [eg. Owicki/Gries proof]

⇒ ⇒ ⇒

slide-14
SLIDE 14
  • Assumptions:
  • (i) Single Object,
  • (ii) State Based,
  • (iii) O is a valid object for I [eg. Owicki/Gries proof]
  • Release Acquire (RA) Memory Model [Lahav&Vafeiadis’15]

Gapless TOE

slide-15
SLIDE 15

Partial Order Axis

  • Assumption: Multiple (2) Objects
  • Client Guarantees:
  • Read Own Writes
  • Monotonicity (Reads/Writes)
  • Preservation of (anti)Dependencies
  • Visibility Properties:
  • Transitive Visibility
  • Causal Visibility
slide-16
SLIDE 16

(TO) (PO)

Concurrent Negotiated total

  • rder updates

Total order, capricious Total order updates + queries Monotonic Reads + Read My Writes Total causal order Rollbacks + Write-Read dependence + Session Order External

slide-17
SLIDE 17

Partial Order Axis (Invariants)

  • Invariants Relating Objects
  • x ≤ y
  • P(x) ⟹ Q(y)
  • Programming:
  • Demarcation Protocol
  • Escrow
  • Assumptions:
  • (i) Multiple Object,
  • (ii) State Based,
  • (iii) O is a valid object for I
slide-18
SLIDE 18

Demarcation Protocol

slide-19
SLIDE 19

Demarcation Protocol*

* Program Order as communication

I = { x y (i. Ai Bi) } x = x + A1; y = y + B1;

  • x = x + A2;

y = y + B2;

  • x = x + A3;

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;

  • y = x + B1;

s1 = true;

  • x = x + A2;

a2 = true;

  • y = x + B2;

s2 = true;

  • x = x + A3;

a3 = true;

  • y = x + B3;

s3 = true;

slide-20
SLIDE 20

Program Order Axis

  • Assumptions:
  • (i) Multiple Object,
  • (ii) State Based,
  • (iii) O is a valid object for I

1 ∼ 1

1 1 1

slide-21
SLIDE 21

Demarcation Protocol

Template Proof for Demarcation-style Programs**

I = { x ( ite(ai, Ai, 0)) y ( ite(si, Bi, 0)) (i. Ai Bi)}

  • x = x + A1;

a1 = true;

  • y = x + B1;

s1 = true;

  • x = x + A2;

a2 = true;

  • y = x + B2;

s2 = true;

  • x = x + A3;

a3 = true;

  • y = x + B3;

s3 = true;

  • **[Lahav&Vafeiadis ghosts are

compatible but slightly different]

slide-22
SLIDE 22

Equality Order Axis

  • Assumption: Multiple (n) Objects
  • Transactions
  • Write-atomicity: All-or-nothing
  • Read-atomicity: Snapshot
  • Consistent Snapshot
slide-23
SLIDE 23

(TO) (PO) (EQ)

Concurrent Negotiated total

  • rder updates

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

  • t

+ c

  • n

s i s t e n t s n a p s h

  • t

S i n g l e

  • p

e r a t i

  • n
slide-24
SLIDE 24

Equality Order Axis

  • Robustness criteria? [Bernardi,Cerone,Gotsman]
  • Assumptions:
  • (i) Multiple Object,
  • (ii) State Based,
  • (iii) O is a valid object for I
slide-25
SLIDE 25

Equality Axis

  • Rely Guarantee approach
  • Every Generator/Effector preserves preconditions

and the invariant

  • CISE tool [Gotsman et al.’16]
slide-26
SLIDE 26

Open Problems & Future Work

  • What about operation-based implementations?

CRDTs?

  • Our characterization of invariants is incomplete