forked from otrack/epaxos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
epaxosproto.go
104 lines (92 loc) · 1.52 KB
/
epaxosproto.go
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package epaxosproto
import (
"epaxos/state"
)
type Prepare struct {
LeaderId int32
Replica int32
Instance int32
Ballot int32
}
type PrepareReply struct {
AcceptorId int32
Replica int32
Instance int32
Ballot int32
VBallot int32
Status int8
Command []state.Command
Seq int32
Deps []int32
}
type PreAccept struct {
LeaderId int32
Replica int32
Instance int32
Ballot int32
Command []state.Command
Seq int32
Deps []int32
}
type PreAcceptReply struct {
Replica int32
Instance int32
Ballot int32
VBallot int32
Seq int32
Deps []int32
CommittedDeps []int32
Status int8
}
type PreAcceptOK struct {
Instance int32
}
type Accept struct {
LeaderId int32
Replica int32
Instance int32
Ballot int32
Seq int32
Deps []int32
}
type AcceptReply struct {
Replica int32
Instance int32
Ballot int32
}
type Commit struct {
LeaderId int32
Replica int32
Instance int32
Ballot int32
Command []state.Command
Seq int32
Deps []int32
}
type TryPreAccept struct {
LeaderId int32
Replica int32
Instance int32
Ballot int32
Command []state.Command
Seq int32
Deps []int32
}
type TryPreAcceptReply struct {
AcceptorId int32
Replica int32
Instance int32
Ballot int32
VBallot int32
ConflictReplica int32
ConflictInstance int32
ConflictStatus int8
}
const (
NONE int8 = iota
PREACCEPTED
PREACCEPTED_EQ
ACCEPTED
COMMITTED
EXECUTED
)