Early Scheduling in Parallel State Machine Replication Eduardo - - PowerPoint PPT Presentation

early scheduling in parallel state machine replication
SMART_READER_LITE
LIVE PREVIEW

Early Scheduling in Parallel State Machine Replication Eduardo - - PowerPoint PPT Presentation

1 Early Scheduling in Parallel State Machine Replication Eduardo Alchieri, Fernando Dotti, and Fernando Pedone Universidade de Brasilia, Pontifica Universidade Catlica do Rio Grande do Sul, and University of Lugano 2 State Machine


slide-1
SLIDE 1

Early Scheduling in Parallel State Machine Replication

Eduardo Alchieri, Fernando Dotti, and Fernando Pedone Universidade de Brasilia, Pontifica Universidade Católica do Rio Grande do Sul, and University of Lugano

1

slide-2
SLIDE 2

State Machine Replication (SMR)

Fundamental approach to fault tolerance Google Spanner Apache Zookeeper Windows Azure Storage MySQL Group Replication Galera Cluster Blockchain, …

2

slide-3
SLIDE 3

SMR is intuitive and simple

3

Clients Servers

R0 R1 R2

same order deterministic execution

R0 R1 R2 R0 R1 R2

slide-4
SLIDE 4

Key observation Independent requests can execute concurrently Conflicting requests must be serialized and executed in the same order by the replicas Two requests conflict if they access common state and at least one of them updates the state

Parallel State Machine Replication

4

slide-5
SLIDE 5

Parallel State Machine Replication

5

R1 R2 R4 R5 R3 R0

scheduler worker worker scheduler worker tx Replica Replica worker ty

R0(x) R2(x) R3(x) R5(x) R1(y) R4(y)

Late scheduling Scheduling happens after 
 requests are ordered Early scheduling Scheduling decisions happen 
 before requests are ordered E.g., worker tx executes 
 requests on X, worker ty 
 executes requests on Y

slide-6
SLIDE 6

Scheduling tradeoff

6 Concurrency Low High Synchronization Overhead Low High

Classic SMR Late Scheduling Ideal Early Scheduling Early Scheduling

This paper

slide-7
SLIDE 7

Our contributions

Generalization of Early Scheduling Classes of requests: expressing application concurrency How to automatically map classes to worker threads How the resulting technique compares to late scheduling

7

slide-8
SLIDE 8

Classes of requests

Readers and writers Class CR: read requests Class CW: write requests

8

CR CW

Internal conflict External conflict

slide-9
SLIDE 9

Mapping classes to workers

Define workers that execute requests 
 in the class Define class type Sequential: one request at a time Concurrent: requests executed 
 concurrently

9

CR CW

Sequential Concurrent t0, …, tk tk, …, tn

slide-10
SLIDE 10

Early Scheduling execution model

10 scheduler

worker t0 worker t1

Replica

class ➝ workers mapping

  • rdered requests

R1, R2,… in class C Class C is CONCURRENT: request assigned to t0 OR t1 R1 R4 R3 R6 R5 R2 R7

slide-11
SLIDE 11

Early Scheduling execution model

11 scheduler

worker t0

R1 R2

worker t1

R1 R2 Replica

class ➝ workers mapping

  • rdered requests

R1, R2,… in class C Class C is SEQUENTIAL: request assigned to t0 AND t1 barrier

slide-12
SLIDE 12

Mapping classes to workers

12

Every class must have at least one worker thread

t0,t1,t2 t3

Rule #1

➝ ➝

C1 C2

If C has internal conflicts, then it must be sequential

Rule #2

CW Sequential C1

If C1 and C2 conflict, at least one must be sequential

Rule #3

Sequential Sequential

  • r

C1 C2

If C1 and C2 conflict, C1 is concurrent, and C2 is sequential, workers of C1 are workers of C2

Rule #4

Sequential Concurrent C1 C2 t0,t1 t0,t1,t2

If C1 and C2 conflict, and are sequential, then C1 and C2 must have one worker in common

Rule #5

Sequential Sequential C1

C2 t0,t1,t2 t2,t3,t4

slide-13
SLIDE 13

Local reads most
 common requests Workers: t0,t1,t2,t3

Mapping classes to workers

13

CR1 CW1 CR2 CW2 CRg CWg

Synchronized

t0, t1, t2 t0, t1, t2, t3 t0, t2, t3 Sequential Concurrent Sequential Concurrent Sequential Concurrent t0, t1 t2, t3 t0, t2

slide-14
SLIDE 14

Optimizing scheduling

O1a: Minimize workers in sequential classes O1b: Maximize workers in concurrent classes O2: Assign workers to concurrent classes in proportion to class weight (i.e., more work, more workers) O3: Minimize unnecessary synchronization among classes

14

slide-15
SLIDE 15

Optimization model

15

. . .

Described in AMPL Solved with KNitro

slide-16
SLIDE 16

Naive vs Optimized mapping

16

Local reads most
 common requests Workers: t0,t1,t2,t3

CR1 CW1 CR2 CW2 CRg CWg

Concurrent t0, t1 Concurrent t2, t3 Sequential t0, t1, t2, t3 Sequential t0, t1 Sequential t2, t3 parallel Sequential t0, t2

slide-17
SLIDE 17

Experimental evaluation

Prototype in BFT-SMaRt environment Early scheduling and late scheduling Configured to crash failures (not BFT) Linked-list application Single- and multi-shard deployments Light, moderate, and heavy execution costs Uniform and skewed workloads

17

slide-18
SLIDE 18

Single-shard, reads, moderate

18

slide-19
SLIDE 19

Multi-shard, mixed, moderate

19

slide-20
SLIDE 20

20

http://www.inf.usi.ch/faculty/ pedone/