forked from acid-state/acid-state
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes on replication.txt
83 lines (57 loc) · 1.99 KB
/
Notes on replication.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Node set
Order events
Serialize events
return results
Statements:
Nodes have identity.
The cluster consists of 1 to 3 nodes.
Update events may not return until they are guaranteed to be durable.
An Update event is durable when it has been serialized on two nodes.
Shared read/write channel. Assume no dropped messages.
NewEvent {event} {counter}
MyOrderCounter {counter}
MySerializeCounter {counter}
An update event has order when it's {counter} is lower than any reported MyOrderCounter.
Ordered updates may be serialized but their results may not be given to the user.
An update event is considered permanently serialized when it's {counter} is lower than the smallest
reported MySerializeCounter of any node majority.
Each node knows which events are guaranteed to have been serialized.
Each node knows how many events they themselves have on disk.
We need to pick a number ranging between the two above numbers and have the cluster agree on it.
1: 4 7 -> 4 7
2: 4 6 -> 4 6
3: 2 5 -> 4 5
1,2 -> 6
1,3 -> 5
1,2,3 -> 6
2,3 -> 5
4 7 -> 6 7
4 6 -> 6 6
4 7 -> 4 7 -> 6 6 -> set status:running
4 6 -> 4 6 -> 6 6 -> set status:running
2 5 -> 4 5 -> -
4 6 -> 4 6 -> 5 5 -> set status:running
2 5 -> 4 5 -> 5 5 -> set status:running
4 7 -> 4 7 -> 5 5 -> set status:running
2 5 -> 4 5 -> 5 5 -> set status:running
4 5
Boot mode:
MySerializeCounter {counter}
Set my guaranteed_serialized to 'max new old'.
When a majority has reported in, pick the highest have_serialized number that will give a majority and set guaranteed_serialized counter.
When guaranteed_serialized == have_serialized
go to running mode
How to unserialize:
Undo checkpoints after cutoff point
unrollUntil
Undo events after cutoff point
unrollTo
Cut to a specific log number
Continue mode:
Cluster channel:
NewNode {identity} {counter} {eventcounter}
DelNode {identity} {counter}
ClusterNodes {counter}
NewEvent {event} {counter}
MyOrderCounter {counter}
MySerializeCounter {counter} {counter}