etcdserver: check recovery error when new server

This commit is contained in:
Yicheng Qin 2014-12-08 14:53:39 -08:00
parent 8c338ffcc7
commit 71f3b80fbe

View File

@ -272,7 +272,9 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
return nil, err
}
if snapshot != nil {
st.Recovery(snapshot.Data)
if err := st.Recovery(snapshot.Data); err != nil {
log.Panicf("etcdserver: recovered store from snapshot error: %v", err)
}
log.Printf("etcdserver: recovered store from snapshot at index %d", snapshot.Metadata.Index)
index = snapshot.Metadata.Index
}