From f063e78cc328564c8791a41c31cf574321f904b1 Mon Sep 17 00:00:00 2001 From: Keyi Xie Date: Mon, 8 Apr 2019 00:00:31 +0800 Subject: [PATCH] store: Add more log (#10019) --- store/store.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/store/store.go b/store/store.go index ee66e78ef3dce..4d3a974faeaa2 100644 --- a/store/store.go +++ b/store/store.go @@ -22,6 +22,7 @@ import ( "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/logutil" + "go.uber.org/zap" ) var stores = make(map[string]kv.Driver) @@ -65,9 +66,15 @@ func newStoreWithRetry(path string, maxRetries int) (kv.Storage, error) { var s kv.Storage err = util.RunWithRetry(maxRetries, util.RetryInterval, func() (bool, error) { - logutil.Logger(context.Background()).Info("new store") + logutil.Logger(context.Background()).Info("new store", zap.String("path", path)) s, err = d.Open(path) return kv.IsRetryableError(err), err }) - return s, err + + if err == nil { + logutil.Logger(context.Background()).Info("new store with retry success") + } else { + logutil.Logger(context.Background()).Warn("new store with retry failed", zap.Error(err)) + } + return s, errors.Trace(err) }