mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Return Unknown instead of NotExist
Unless the data dir truly does not exist.
This commit is contained in:
parent
e4c0f5c1a8
commit
421fe128c3
@ -37,7 +37,7 @@ const (
|
||||
|
||||
func DetectVersion(dirpath string) WalVersion {
|
||||
names, err := fileutil.ReadDir(dirpath)
|
||||
if err != nil || len(names) == 0 {
|
||||
if err != nil {
|
||||
return WALNotExist
|
||||
}
|
||||
nameSet := types.NewUnsafeSet(names...)
|
||||
@ -46,7 +46,6 @@ func DetectVersion(dirpath string) WalVersion {
|
||||
if Exist(path.Join(dirpath, "wal")) {
|
||||
return WALv0_5
|
||||
}
|
||||
return WALNotExist
|
||||
}
|
||||
if nameSet.ContainsAll([]string{"snapshot", "conf", "log"}) {
|
||||
return WALv0_4
|
||||
|
Loading…
x
Reference in New Issue
Block a user