|
@@ -79,6 +79,13 @@ type apply struct {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type raftNode struct {
|
|
type raftNode struct {
|
|
|
|
|
+ // Cache of the latest raft index and raft term the server has seen.
|
|
|
|
|
+ // These three unit64 fields must be the first elements to keep 64-bit
|
|
|
|
|
+ // alignment for atomic access to the fields.
|
|
|
|
|
+ index uint64
|
|
|
|
|
+ term uint64
|
|
|
|
|
+ lead uint64
|
|
|
|
|
+
|
|
|
raft.Node
|
|
raft.Node
|
|
|
|
|
|
|
|
// a chan to send out apply
|
|
// a chan to send out apply
|
|
@@ -99,11 +106,6 @@ type raftNode struct {
|
|
|
// If transport is nil, server will panic.
|
|
// If transport is nil, server will panic.
|
|
|
transport rafthttp.Transporter
|
|
transport rafthttp.Transporter
|
|
|
|
|
|
|
|
- // Cache of the latest raft index and raft term the server has seen
|
|
|
|
|
- index uint64
|
|
|
|
|
- term uint64
|
|
|
|
|
- lead uint64
|
|
|
|
|
-
|
|
|
|
|
stopped chan struct{}
|
|
stopped chan struct{}
|
|
|
done chan struct{}
|
|
done chan struct{}
|
|
|
}
|
|
}
|