Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
80644: roachtest: set cluster setting separately from index build r=rhu713 a=stevendanna

The nightly roachtest failed with:

    pq: SET CLUSTER SETTING cannot be used inside a multi-statement transaction

This change obeys this edict by issuing the SET CLUSTER SETTING
statement in its own transaction.

Fixes cockroachdb#80613

Release note: None

Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
craig[bot] and stevendanna committed Apr 28, 2022
2 parents a3ca090 + 58a5891 commit 2ce801c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cmd/roachtest/tests/indexbackfiller.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ func registerIndexBackfill(r registry.Registry) {
// Create index using old index backfiller after workload has finished.
time.Sleep(duration / 10)
createStmt := fmt.Sprintf(randTest.createFmt, oldIdx)
alterCmd := `SET CLUSTER SETTING sql.mvcc_compliant_index_creation.enabled = false; %s;`

t.Status("creating index using old index backfiller")
if _, err := db.ExecContext(ctx, fmt.Sprintf(alterCmd, createStmt)); err != nil {
if _, err := db.ExecContext(ctx, `SET CLUSTER SETTING sql.mvcc_compliant_index_creation.enabled = false`); err != nil {
t.Fatal(err)
}
if _, err := db.ExecContext(ctx, createStmt); err != nil {
t.Fatal(err)
}

Expand Down

0 comments on commit 2ce801c

Please sign in to comment.