Skip to content

Commit

Permalink
etcdserver: always recover lessor first
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 committed Aug 4, 2016
1 parent cabd285 commit 29a077b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,12 @@ func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {

newbe := backend.NewDefaultBackend(fn)

if s.lessor != nil {
plog.Info("recovering lessor...")
s.lessor.Recover(newbe, s.kv)
plog.Info("finished recovering lessor")
}

plog.Info("restoring mvcc store...")

if err := s.kv.Restore(newbe); err != nil {
Expand All @@ -686,12 +692,6 @@ func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {
s.be = newbe
s.bemu.Unlock()

if s.lessor != nil {
plog.Info("recovering lessor...")
s.lessor.Recover(newbe, s.kv)
plog.Info("finished recovering lessor")
}

plog.Info("recovering alarms...")
if err := s.restoreAlarms(); err != nil {
plog.Panicf("restore alarms error: %v", err)
Expand Down

0 comments on commit 29a077b

Please sign in to comment.