Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
106509: upgrades: fix transaction retry bug in auto config job migration r=knz a=stevendanna

The SELECT query here, despite being inside the func passed to Txn wasn't actually using the transaction. If the Txn retries, then the following select appears to hang forever.

This has not been observed in any real-world test but was observed when experimenting with randomly injecting retryable errors (cockroachdb#106506).

Epic: none

Release note: None

Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
craig[bot] and stevendanna committed Jul 10, 2023
2 parents ee0b0d6 + 85e1845 commit 28fad87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/upgrade/upgrades/create_auto_config_runner_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ func createAutoConfigRunnerJob(
}

if err := d.DB.Txn(ctx, func(ctx context.Context, txn isql.Txn) error {
row, err := d.DB.Executor().QueryRowEx(
row, err := txn.QueryRowEx(
ctx,
"check for existing auto config runner job",
nil,
txn.KV(),
sessiondata.RootUserSessionDataOverride,
"SELECT 1 FROM system.jobs WHERE id = $1",
jobs.AutoConfigRunnerJobID,
Expand Down

0 comments on commit 28fad87

Please sign in to comment.