mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #15582 from chaochn47/fix_TestEtcdExampleConfig
skip verification if db file does not exist
This commit is contained in:
commit
c41e47fd5f
@ -19,13 +19,15 @@ import (
|
|||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
"go.etcd.io/raft/v3/raftpb"
|
||||||
|
|
||||||
|
"go.etcd.io/etcd/client/pkg/v3/fileutil"
|
||||||
"go.etcd.io/etcd/client/pkg/v3/verify"
|
"go.etcd.io/etcd/client/pkg/v3/verify"
|
||||||
"go.etcd.io/etcd/server/v3/storage/backend"
|
"go.etcd.io/etcd/server/v3/storage/backend"
|
||||||
"go.etcd.io/etcd/server/v3/storage/datadir"
|
"go.etcd.io/etcd/server/v3/storage/datadir"
|
||||||
"go.etcd.io/etcd/server/v3/storage/schema"
|
"go.etcd.io/etcd/server/v3/storage/schema"
|
||||||
wal2 "go.etcd.io/etcd/server/v3/storage/wal"
|
wal2 "go.etcd.io/etcd/server/v3/storage/wal"
|
||||||
"go.etcd.io/etcd/server/v3/storage/wal/walpb"
|
"go.etcd.io/etcd/server/v3/storage/wal/walpb"
|
||||||
"go.etcd.io/raft/v3/raftpb"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const ENV_VERIFY_VALUE_STORAGE_WAL verify.VerificationType = "storage_wal"
|
const ENV_VERIFY_VALUE_STORAGE_WAL verify.VerificationType = "storage_wal"
|
||||||
@ -53,6 +55,11 @@ func Verify(cfg Config) error {
|
|||||||
lg = zap.NewNop()
|
lg = zap.NewNop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !fileutil.Exist(datadir.ToBackendFileName(cfg.DataDir)) {
|
||||||
|
lg.Info("verification skipped due to non exist db file")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
lg.Info("verification of persisted state", zap.String("data-dir", cfg.DataDir))
|
lg.Info("verification of persisted state", zap.String("data-dir", cfg.DataDir))
|
||||||
defer func() {
|
defer func() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user