Skip to content

Commit

Permalink
Update based on review from Morgan
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Sep 14, 2021
1 parent a2e490b commit 25b6d36
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,13 @@ func (m temporaryTableKVFilter) IsUnnecessaryKeyValue(key, value []byte, flags t
// of the errors defined in kv/error.go, these look to be clearly related to a client-inflicted issue,
// and the server is only responsible for handling the error correctly. It does not need to log.
func errIsNoisy(err error) bool {
return kv.ErrKeyExists.Equal(err)
if kv.ErrKeyExists.Equal(err) {
return true
}
if storeerr.ErrLockAcquireFailAndNoWaitSet.Equal(err) {
return true
}
return false
}

func (s *session) doCommitWithRetry(ctx context.Context) error {
Expand Down Expand Up @@ -1569,7 +1575,7 @@ func (s *session) ExecuteStmt(ctx context.Context, stmtNode ast.StmtNode) (sqlex
logStmt(stmt, s)
recordSet, err := runStmt(ctx, s, stmt)
if err != nil {
if !kv.ErrKeyExists.Equal(err) && !storeerr.ErrLockAcquireFailAndNoWaitSet.Equal(err) {
if !errIsNoisy(err) {
logutil.Logger(ctx).Warn("run statement failed",
zap.Int64("schemaVersion", s.GetInfoSchema().SchemaMetaVersion()),
zap.Error(err),
Expand Down

0 comments on commit 25b6d36

Please sign in to comment.