From c69d2533b3220b95d3a252d51b292631e2db3162 Mon Sep 17 00:00:00 2001 From: Alex Barganier Date: Mon, 7 Aug 2023 11:30:25 -0400 Subject: [PATCH 1/2] roachtest: increase timeout for network_logging to 60s Addresses: https://github.com/cockroachdb/cockroach/issues/108088 The new network_logging roachtest sets a pgclient timeout of 10s to attempt detecting deadlocks. This timeout was hit fairly easily during the nightly runs. This is an indication that our 10s timeout is too aggressive. This PR changes the timeout from 10s to 60s which still achieves the original aim without being so aggressive. Release note: none --- pkg/cmd/roachtest/tests/network_logging.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/tests/network_logging.go b/pkg/cmd/roachtest/tests/network_logging.go index 35fb68f698bf..31beb2213951 100644 --- a/pkg/cmd/roachtest/tests/network_logging.go +++ b/pkg/cmd/roachtest/tests/network_logging.go @@ -90,7 +90,8 @@ func registerNetworkLogging(r registry.Registry) { // URLs already are wrapped in '', but we need to add a timeout flag. // Trim the trailing ' and re-add with the flag. trimmed := strings.TrimSuffix(url, "'") - workloadPGURLs[i] = fmt.Sprintf("%s&statement_timeout=10s'", trimmed) + // Define a 60s client statement timeout. + workloadPGURLs[i] = fmt.Sprintf("%s&statement_timeout=60000'", trimmed) } // Init & run a workload on the workload node. From 80b8bf88b78ce993bcae0b171c42d8755e0e6c04 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Mon, 7 Aug 2023 21:41:58 +0000 Subject: [PATCH 2/2] kvserver: deflake lease preferences during outage Previously, it was possible for a soon to be dead replica, to acquire the range lease in the `TestLeasePreferencesDuringOutage` test. The acquired lease would be expiration based, disallowing the intended leaseholder from acquiring the lease. This patch disables expiration based lease transfers, deflaking the test. Resolves: #105101 Epic: none Release note: None --- pkg/kv/kvserver/client_lease_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/kv/kvserver/client_lease_test.go b/pkg/kv/kvserver/client_lease_test.go index 01134c494eb8..35ce53d70084 100644 --- a/pkg/kv/kvserver/client_lease_test.go +++ b/pkg/kv/kvserver/client_lease_test.go @@ -947,6 +947,13 @@ func TestLeasePreferencesDuringOutage(t *testing.T) { locality("us", "mi"), locality("us", "mi"), } + // Disable expiration based lease transfers. It is possible that a (pseudo) + // dead node acquires the lease and we are forced to wait out the expiration + // timer, if this were not set. + settings := cluster.MakeTestingClusterSettings() + sv := &settings.SV + kvserver.TransferExpirationLeasesFirstEnabled.Override(ctx, sv, false) + kvserver.ExpirationLeasesOnly.Override(ctx, sv, false) for i := 0; i < numNodes; i++ { serverArgs[i] = base.TestServerArgs{ Locality: localities[i],