Skip to content

Commit

Permalink
Merge #140187
Browse files Browse the repository at this point in the history
140187: logictest: disable autocommit_before_ddl under 3node-tenant r=yuzefovich a=rafiss

A recent change to the default value of this setting appears to have made many 3node-tenant tests flaky. This patch goes back to the old value for multitenant configs while we investigate.

informs #140162, #140163, #140170, #140172, #140183, #140182, #140173, #140171, #140168, #140164, 
Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed Jan 31, 2025
2 parents 5b93185 + c511eb7 commit 51db1cb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
10 changes: 10 additions & 0 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,16 @@ func (t *logicTest) newCluster(
tenantID := serverutils.TestTenantID()
conn := t.cluster.SystemLayer(0).SQLConn(t.rootT)

// TODO(rafi): Remove this setting. We're adding it since the 3node-tenant
// config seem to be flaky with autcommit_before_ddl = true. Disable that
// setting for multitenant configs while the issue is being investigated.
if _, err := conn.Exec(
"ALTER TENANT [$1] SET CLUSTER SETTING sql.defaults.autocommit_before_ddl.enabled = false",
tenantID.ToUint64(),
); err != nil {
t.Fatal(err)
}

clusterSettings := toa.clusterSettings
if len(clusterSettings) > 0 {
// We reduce the closed timestamp duration on the host tenant so that the
Expand Down
8 changes: 5 additions & 3 deletions pkg/sql/logictest/testdata/logic_test/drop_index
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,15 @@ fk1 CREATE TABLE public.fk1 (
# test that notices are generated on index drops
subtest notice_on_drop_index

statement ok
CREATE TABLE drop_index_test(a int);
CREATE INDEX drop_index_test_index ON drop_index_test(a);

# Weak isolation levels emit extra notices, so skip them.
skipif config weak-iso-level-configs
query T noticetrace
CREATE TABLE drop_index_test(a int); CREATE INDEX drop_index_test_index ON drop_index_test(a); DROP INDEX drop_index_test_index
DROP INDEX drop_index_test_index
----
NOTICE: auto-committing transaction before processing DDL due to autocommit_before_ddl setting
NOTICE: auto-committing transaction before processing DDL due to autocommit_before_ddl setting
NOTICE: the data for dropped indexes is reclaimed asynchronously
HINT: The reclamation delay can be customized in the zone configuration for the table.

Expand Down
6 changes: 3 additions & 3 deletions pkg/sql/logictest/testdata/logic_test/txn
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ ROLLBACK TRANSACTION
# COMMIT/ROLLBACK without a transaction are allowed when autocommit_before_ddl=true.

statement ok
RESET autocommit_before_ddl
SET autocommit_before_ddl = true

statement ok
COMMIT TRANSACTION
Expand All @@ -207,7 +207,7 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
# Set isolation level without a transaction is a warning when autocommit_before_ddl=true.

statement ok
RESET autocommit_before_ddl
SET autocommit_before_ddl = true

query T noticetrace
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
Expand Down Expand Up @@ -544,7 +544,7 @@ statement error pgcode 25P01 there is no transaction in progress
SET TRANSACTION PRIORITY LOW

statement ok
RESET autocommit_before_ddl
SET autocommit_before_ddl = true

query T noticetrace
SET TRANSACTION PRIORITY LOW
Expand Down

0 comments on commit 51db1cb

Please sign in to comment.