Skip to content

Commit

Permalink
kvserver: deflake lease preferences during outage
Browse files Browse the repository at this point in the history
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: cockroachdb#105101
Epic: none

Release note: None
  • Loading branch information
kvoli committed Aug 8, 2023
1 parent 1382b26 commit 80b8bf8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/kv/kvserver/client_lease_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 80b8bf8

Please sign in to comment.