From 29a077bdbe287c796775ead254506c6b6c794a6b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Thu, 4 Aug 2016 08:06:19 -0700 Subject: [PATCH] etcdserver: always recover lessor first --- etcdserver/server.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etcdserver/server.go b/etcdserver/server.go index 4da708f6d32..41c82944b79 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -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 { @@ -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)