etcdserver: restore v3 storage when restart

To load the previous data.
release-2.3
Yicheng Qin 2015-09-21 15:11:37 -07:00
parent 9de7f24301
commit 5d906a0acc
1 changed files with 3 additions and 0 deletions

View File

@ -340,6 +340,9 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
return nil, err
}
srv.kv = dstorage.New(path.Join(cfg.StorageDir(), databaseFilename))
if err := srv.kv.Restore(); err != nil {
plog.Fatalf("v3 storage restore error: %v", err)
}
}
// TODO: move transport initialization near the definition of remote