Skip to content

Commit

Permalink
sql: step read committed txn on statement retry
Browse files Browse the repository at this point in the history
This commit steps a read committed transaction's read sequence after
each statement retry. This ensures that the read sequence leads the
ignored sequence number range established when the read committed
statement savepoint was rolled back.

Epic: None
Release note: None
  • Loading branch information
nvanbenschoten committed Apr 4, 2024
1 parent cddc3ac commit 380f0c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sql/conn_executor_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,9 @@ func (ex *connExecutor) dispatchReadCommittedStmtToExecutionEngine(
if err := ex.state.mu.txn.PrepareForPartialRetry(ctx); err != nil {
return err
}
if err := ex.state.mu.txn.Step(ctx, false /* allowReadTimestampStep */); err != nil {
return err
}
ex.state.mu.autoRetryCounter++
ex.state.mu.autoRetryReason = txnRetryErr
}
Expand Down

0 comments on commit 380f0c0

Please sign in to comment.