mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: clarify errors from "openSnapshotBackend"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
e2af59e4d1
commit
47ab4e22d2
@ -42,10 +42,10 @@ func newBackend(cfg ServerConfig) backend.Backend {
|
||||
func openSnapshotBackend(cfg ServerConfig, ss *raftsnap.Snapshotter, snapshot raftpb.Snapshot) (backend.Backend, error) {
|
||||
snapPath, err := ss.DBFilePath(snapshot.Metadata.Index)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("database snapshot file path error: %v", err)
|
||||
return nil, fmt.Errorf("failed to find database snapshot file (%v)", err)
|
||||
}
|
||||
if err := os.Rename(snapPath, cfg.backendPath()); err != nil {
|
||||
return nil, fmt.Errorf("rename snapshot file error: %v", err)
|
||||
return nil, fmt.Errorf("failed to rename database snapshot file (%v)", err)
|
||||
}
|
||||
return openBackend(cfg), nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user