From a153f19e25d9bec8ba4331af817419cdcebec400 Mon Sep 17 00:00:00 2001 From: pingcap-github-bot Date: Wed, 8 Apr 2020 10:52:55 +0800 Subject: [PATCH] session: fix incorrect OPS on unretryable session error (#14557) (#16120) --- session/session.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/session/session.go b/session/session.go index daf58465fd464..35cbe20ac6b46 100644 --- a/session/session.go +++ b/session/session.go @@ -124,7 +124,7 @@ type Session interface { Close() Auth(user *auth.UserIdentity, auth []byte, salt []byte) bool ShowProcess() *util.ProcessInfo - // PrePareTxnCtx is exported for test. + // PrepareTxnCtx is exported for test. PrepareTxnCtx(context.Context) // FieldList returns fields list of a table. FieldList(tableName string) (fields []*ast.ResultField, err error) @@ -187,7 +187,7 @@ type session struct { // ddlOwnerChecker is used in `select tidb_is_ddl_owner()` statement; ddlOwnerChecker owner.DDLOwnerChecker - // shared coprocessor client per session + // client shared coprocessor client per session client kv.Client // lockedTables use to record the table locks hold by the session. @@ -718,7 +718,7 @@ func (s *session) retry(ctx context.Context, maxCnt uint) (err error) { zap.String("label", label), zap.Stringer("session", s), zap.Error(err)) - metrics.SessionRetryErrorCounter.WithLabelValues(label, metrics.LblUnretryable) + metrics.SessionRetryErrorCounter.WithLabelValues(label, metrics.LblUnretryable).Inc() return err } retryCnt++ @@ -726,7 +726,7 @@ func (s *session) retry(ctx context.Context, maxCnt uint) (err error) { logutil.Logger(ctx).Warn("sql", zap.String("label", label), zap.Uint("retry reached max count", retryCnt)) - metrics.SessionRetryErrorCounter.WithLabelValues(label, metrics.LblReachMax) + metrics.SessionRetryErrorCounter.WithLabelValues(label, metrics.LblReachMax).Inc() return err } logutil.Logger(ctx).Warn("sql",