|
@@ -608,6 +608,7 @@ type etcdProgress struct {
|
|
|
type raftReadyHandler struct {
|
|
type raftReadyHandler struct {
|
|
|
updateLeadership func()
|
|
updateLeadership func()
|
|
|
updateCommittedIndex func(uint64)
|
|
updateCommittedIndex func(uint64)
|
|
|
|
|
+ waitForApply func()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (s *EtcdServer) run() {
|
|
func (s *EtcdServer) run() {
|
|
@@ -616,6 +617,9 @@ func (s *EtcdServer) run() {
|
|
|
plog.Panicf("get snapshot from raft storage error: %v", err)
|
|
plog.Panicf("get snapshot from raft storage error: %v", err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // asynchronously accept apply packets, dispatch progress in-order
|
|
|
|
|
+ sched := schedule.NewFIFOScheduler()
|
|
|
|
|
+
|
|
|
var (
|
|
var (
|
|
|
smu sync.RWMutex
|
|
smu sync.RWMutex
|
|
|
syncC <-chan time.Time
|
|
syncC <-chan time.Time
|
|
@@ -663,11 +667,12 @@ func (s *EtcdServer) run() {
|
|
|
s.setCommittedIndex(ci)
|
|
s.setCommittedIndex(ci)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ waitForApply: func() {
|
|
|
|
|
+ sched.WaitFinish(0)
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
s.r.start(rh)
|
|
s.r.start(rh)
|
|
|
|
|
|
|
|
- // asynchronously accept apply packets, dispatch progress in-order
|
|
|
|
|
- sched := schedule.NewFIFOScheduler()
|
|
|
|
|
ep := etcdProgress{
|
|
ep := etcdProgress{
|
|
|
confState: sn.Metadata.ConfState,
|
|
confState: sn.Metadata.ConfState,
|
|
|
snapi: sn.Metadata.Index,
|
|
snapi: sn.Metadata.Index,
|