mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raftsnap: clarify "ErrNoDBSnapshot"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
@@ -76,9 +76,18 @@ func (s *Snapshotter) DBFilePath(id uint64) (string, error) {
|
||||
if _, err := fileutil.ReadDir(s.dir); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if fn := s.dbFilePath(id); fileutil.Exist(fn) {
|
||||
fn := s.dbFilePath(id)
|
||||
if fileutil.Exist(fn) {
|
||||
return fn, nil
|
||||
}
|
||||
if s.lg != nil {
|
||||
s.lg.Warn(
|
||||
"failed to find [SNAPSHOT-INDEX].snap.db",
|
||||
zap.Uint64("snapshot-index", id),
|
||||
zap.String("snapshot-file-path", fn),
|
||||
zap.Error(ErrNoDBSnapshot),
|
||||
)
|
||||
}
|
||||
return "", ErrNoDBSnapshot
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user