mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #1882 from yichengq/256
etcdserver: correct the log about recovering from snapshot
This commit is contained in:
commit
dfbe16445d
@ -272,14 +272,16 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
|
||||
return nil, err
|
||||
}
|
||||
if snapshot != nil {
|
||||
log.Printf("etcdserver: recovering from snapshot at index %d", snapshot.Metadata.Index)
|
||||
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
|
||||
}
|
||||
cfg.Cluster = NewClusterFromStore(cfg.Cluster.token, st)
|
||||
cfg.Print()
|
||||
if snapshot != nil {
|
||||
log.Printf("etcdserver: loaded peers from snapshot: %s", cfg.Cluster)
|
||||
log.Printf("etcdserver: loaded cluster information from store: %s", cfg.Cluster)
|
||||
}
|
||||
if !cfg.ForceNewCluster {
|
||||
id, n, s, w = restartNode(cfg, index+1, snapshot)
|
||||
|
Loading…
x
Reference in New Issue
Block a user