Skip to content

Commit 77f7cea

Browse files
craig[bot]rafiss
andcommitted
Merge #149102
149102: roachtest: deflake tpcc/multiregion r=rafiss a=rafiss The test requires the schema to be unlocked to make a locality change. fixes #149086 fixes #149084 Release note: None Co-authored-by: Rafi Shamim <[email protected]>
2 parents ab5f159 + 9694b4d commit 77f7cea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/workload/tpcc/tpcc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,16 @@ func (w *tpcc) Hooks() workload.Hooks {
621621
// extraordinarily longer. If data is imported with IMPORT, this
622622
// statement is idempotent.
623623
if len(w.multiRegionCfg.regions) > 0 {
624+
// Locality changes can only be made if schema_locked is toggled.
625+
if _, err := db.Exec(`ALTER TABLE item SET (schema_locked=false)`); err != nil {
626+
return err
627+
}
624628
if _, err := db.Exec(fmt.Sprintf(`ALTER TABLE item SET %s`, localityGlobalSuffix)); err != nil {
625629
return err
626630
}
631+
if _, err := db.Exec(`ALTER TABLE item SET (schema_locked=true)`); err != nil {
632+
return err
633+
}
627634
}
628635
}
629636

0 commit comments

Comments
 (0)