Skip to content

Commit

Permalink
Merge pull request #140624 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-24.3-140607

release-24.3: logictest: raise TxnLivenessThreshold for multitenant configs
  • Loading branch information
rafiss authored Feb 6, 2025
2 parents 5d78d29 + a82c963 commit 12043c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/sql/logictest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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 @@ -42,6 +42,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 @@ -1709,6 +1710,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 @@ -4353,6 +4369,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

0 comments on commit 12043c7

Please sign in to comment.