Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logictest: raise TxnLivenessThreshold for multitenant configs #140607

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/sql/logictest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ go_library(
"//pkg/kv/kvclient/rangefeed",
"//pkg/kv/kvserver",
"//pkg/kv/kvserver/kvserverbase",
"//pkg/kv/kvserver/txnwait",
"//pkg/multitenant/tenantcapabilities",
"//pkg/security/username",
"//pkg/server",
Expand Down
28 changes: 28 additions & 0 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/txnwait"
"github.com/cockroachdb/cockroach/pkg/multitenant/tenantcapabilities"
"github.com/cockroachdb/cockroach/pkg/security/username"
"github.com/cockroachdb/cockroach/pkg/server"
Expand Down Expand Up @@ -1708,6 +1709,21 @@ func (t *logicTest) newCluster(
t.Fatal(err)
}
}
if _, err := conn.Exec(
"RESET CLUSTER SETTING kv.closed_timestamp.target_duration",
); err != nil {
t.Fatal(err)
}
if _, err := conn.Exec(
"RESET CLUSTER SETTING kv.closed_timestamp.side_transport_interval",
); err != nil {
t.Fatal(err)
}
if _, err := conn.Exec(
"RESET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval",
); err != nil {
t.Fatal(err)
}
}

capabilities := toa.capabilities
Expand Down Expand Up @@ -4373,6 +4389,18 @@ func RunLogicTest(
if *printErrorSummary {
defer lt.printErrorSummary()
}
if config.UseSecondaryTenant == logictestbase.Always {
// Under multitenant configs running in EngFlow, we have seen that logic
// tests can be flaky due to an overload condition where schema change
// transactions do not heartbeat quickly enough. This allows background jobs
// such as the spanconfig reconciler or the job registry "remove claims from
// dead sessions" loop.
// See https://github.com/cockroachdb/cockroach/pull/140400#issuecomment-2634346278
// and https://github.com/cockroachdb/cockroach/issues/140494#issuecomment-2640208187
// for a detailed analysis of this issue.
cleanup := txnwait.TestingOverrideTxnLivenessThreshold(30 * time.Second)
defer cleanup()
}
// Each test needs a copy because of Parallel
serverArgsCopy := serverArgs
serverArgsCopy.ForceProductionValues = serverArgs.ForceProductionValues || nonMetamorphicBatchSizes
Expand Down