Skip to content

Commit e5b76a4

Browse files
craig[bot]yuzefovich
andcommitted
Merge #153696
153696: roachtest: disable auto stats in atomic copyfrom r=yuzefovich a=yuzefovich Previously, the following scenario was possible: - we have atomic COPY meaning that we create multiple KV batches within a single txn. That txn lasts for about 2 minutes - a concurrent AUTO CREATE STATS job is kicked off, and it uses AOST -30s, so it'll contend with the long-running COPY txn. This commit simply disables auto stats to avoid this type of flake (this is kinda a known limitation of the atomic COPY). Fixes: #151905. Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents 4109373 + 7cae904 commit e5b76a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/cmd/roachtest/tests/copyfrom.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ func runCopyFromCRDB(ctx context.Context, t test.Test, c cluster.Cluster, sf int
158158
"CREATE USER importer WITH PASSWORD '123'",
159159
fmt.Sprintf("ALTER ROLE importer SET copy_from_atomic_enabled = %t", atomic),
160160
}
161+
if atomic {
162+
// Disable auto stats collection so that it doesn't contend with the
163+
// long-running atomic COPY txn.
164+
stmts = append(stmts, "SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false")
165+
}
161166
for _, stmt := range stmts {
162167
_, err = db.ExecContext(ctx, stmt)
163168
if err != nil {

0 commit comments

Comments
 (0)