Skip to content

Commit

Permalink
Merge pull request #13501 from ahrtr/reset_ci_after_reload_db_3.5
Browse files Browse the repository at this point in the history
[3.5] Set the backend again after recovering v3 backend from snapshot
  • Loading branch information
ptabor authored Dec 6, 2021
2 parents e84c611 + 8c81598 commit 73080a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ func NewServer(cfg config.ServerConfig) (srv *EtcdServer, err error) {
if be, err = recoverSnapshotBackend(cfg, be, *snapshot, beExist, beHooks); err != nil {
cfg.Logger.Panic("failed to recover v3 backend from snapshot", zap.Error(err))
}
// A snapshot db may have already been recovered, and the old db should have
// already been closed in this case, so we should set the backend again.
ci.SetBackend(be)
s1, s2 := be.Size(), be.SizeInUse()
cfg.Logger.Info(
"recovered v3 backend from snapshot",
Expand Down

0 comments on commit 73080a7

Please sign in to comment.