mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: hide Campaign rules on applying all entries
This commit is contained in:
@@ -103,9 +103,14 @@ func NewRawNode(config *Config, peers []Peer) (*RawNode, error) {
|
||||
r.addNode(peer.ID)
|
||||
}
|
||||
}
|
||||
|
||||
// Set the initial hard and soft states after performing all initialization.
|
||||
rn.prevSoftSt = r.softState()
|
||||
rn.prevHardSt = r.hardState()
|
||||
if lastIndex == 0 {
|
||||
rn.prevHardSt = emptyState
|
||||
} else {
|
||||
rn.prevHardSt = r.hardState()
|
||||
}
|
||||
|
||||
return rn, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user