etcdserver: remove redundant storage restore operation
@@ -21,8 +21,6 @@ import (
"go.etcd.io/etcd/etcdserver/api/snap"
"go.etcd.io/etcd/etcdserver/cindex"
- "go.etcd.io/etcd/lease"
- "go.etcd.io/etcd/mvcc"
"go.etcd.io/etcd/mvcc/backend"
"go.etcd.io/etcd/raft/raftpb"
@@ -96,9 +94,7 @@ func openBackend(cfg ServerConfig) backend.Backend {
// case, replace the db with the snapshot db sent by the leader.
func recoverSnapshotBackend(cfg ServerConfig, oldbe backend.Backend, snapshot raftpb.Snapshot) (backend.Backend, error) {
ci := cindex.NewConsistentIndex(oldbe.BatchTx())
- kv := mvcc.New(cfg.Logger, oldbe, &lease.FakeLessor{}, ci, mvcc.StoreConfig{CompactionBatchLimit: cfg.CompactionBatchLimit})
- defer kv.Close()
- if snapshot.Metadata.Index <= kv.ConsistentIndex() {
+ if snapshot.Metadata.Index <= ci.ConsistentIndex() {
return oldbe, nil
}
oldbe.Close()
