mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: consistent naming in raftReadyHandler
This commit is contained in:
parent
67c75606db
commit
2a1bae0c2a
@ -162,7 +162,7 @@ func (r *raftNode) start(rh *raftReadyHandler) {
|
|||||||
|
|
||||||
atomic.StoreUint64(&r.lead, rd.SoftState.Lead)
|
atomic.StoreUint64(&r.lead, rd.SoftState.Lead)
|
||||||
islead = rd.RaftState == raft.StateLeader
|
islead = rd.RaftState == raft.StateLeader
|
||||||
rh.leadershipUpdate()
|
rh.updateLeadership()
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(rd.ReadStates) != 0 {
|
if len(rd.ReadStates) != 0 {
|
||||||
|
@ -598,7 +598,7 @@ type etcdProgress struct {
|
|||||||
// and helps decouple state machine logic from Raft algorithms.
|
// and helps decouple state machine logic from Raft algorithms.
|
||||||
// TODO: add a state machine interface to apply the commit entries and do snapshot/recover
|
// TODO: add a state machine interface to apply the commit entries and do snapshot/recover
|
||||||
type raftReadyHandler struct {
|
type raftReadyHandler struct {
|
||||||
leadershipUpdate func()
|
updateLeadership func()
|
||||||
updateCommittedIndex func(uint64)
|
updateCommittedIndex func(uint64)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,7 +624,7 @@ func (s *EtcdServer) run() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
rh := &raftReadyHandler{
|
rh := &raftReadyHandler{
|
||||||
leadershipUpdate: func() {
|
updateLeadership: func() {
|
||||||
if !s.isLeader() {
|
if !s.isLeader() {
|
||||||
if s.lessor != nil {
|
if s.lessor != nil {
|
||||||
s.lessor.Demote()
|
s.lessor.Demote()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user