Skip to content

Commit

Permalink
session: fix incorrect OPS on unretryable session error (pingcap#14557)…
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored Apr 8, 2020
1 parent f2ebfa2 commit a153f19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -718,15 +718,15 @@ 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++
if retryCnt >= maxCnt {
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",
Expand Down

0 comments on commit a153f19

Please sign in to comment.