Skip to content

Commit

Permalink
Merge pull request #91477 from cockroachdb/blathers/backport-release-…
Browse files Browse the repository at this point in the history
…22.2-91450

release-22.2: workload/schemachange: address intermittent failures with select stmts
  • Loading branch information
fqazi authored Nov 9, 2022
2 parents 82ae805 + 9a226bb commit fde4a15
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3537,6 +3537,16 @@ func (og *operationGenerator) selectStmt(ctx context.Context, tx pgx.Tx) (stmt *
}
}
if err := rows.Err(); err != nil {
pgErr := new(pgconn.PgError)
// For select statements, we can have out of memory or temporary
// space errors at runtime when fetching the result set. So,
// deal with the min here.
if errors.As(err, &pgErr) &&
stmt.potentialExecErrors.contains(pgcode.MakeCode(pgErr.Code)) {
return errors.Mark(errors.Wrap(err, "ROLLBACK; Successfully got expected execution error."),
errRunInTxnRbkSentinel,
)
}
return err
}
return nil
Expand Down

0 comments on commit fde4a15

Please sign in to comment.