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
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
Eduardo Alchieri, Fernando Dotti, and Fernando Pedone Universidade de Brasilia, Pontifica Universidade Católica do Rio Grande do Sul, and University of Lugano
1
Fundamental approach to fault tolerance Google Spanner Apache Zookeeper Windows Azure Storage MySQL Group Replication Galera Cluster Blockchain, …
2
3
R0 R1 R2
same order deterministic execution
R0 R1 R2 R0 R1 R2
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
4
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
6 Concurrency Low High Synchronization Overhead Low High
Classic SMR Late Scheduling Ideal Early Scheduling Early Scheduling
This paper
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
Readers and writers Class CR: read requests Class CW: write requests
8
CR CW
Internal conflict External conflict
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
10 scheduler
worker t0 worker t1
Replica
class ➝ workers mapping
R1, R2,… in class C Class C is CONCURRENT: request assigned to t0 OR t1 R1 R4 R3 R6 R5 R2 R7
11 scheduler
worker t0
R1 R2
worker t1
R1 R2 Replica
class ➝ workers mapping
R1, R2,… in class C Class C is SEQUENTIAL: request assigned to t0 AND t1 barrier
12
Every class must have at least one worker thread
➝ ➝
If C has internal conflicts, then it must be sequential
CW Sequential C1
If C1 and C2 conflict, at least one must be sequential
If C1 and C2 conflict, C1 is concurrent, and C2 is sequential, workers of C1 are workers of C2
If C1 and C2 conflict, and are sequential, then C1 and C2 must have one worker in common
Sequential Sequential C1
Local reads most common requests Workers: t0,t1,t2,t3
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
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
15
. . .
Described in AMPL Solved with KNitro
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
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
18
19
20