Skip to content

Commit

Permalink
Merge pull request #108362 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.1-108333
  • Loading branch information
kvoli authored Aug 8, 2023
2 parents afb431a + 8d620f9 commit 6153b91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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 @@ -950,6 +950,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
4 changes: 2 additions & 2 deletions pkg/kv/kvserver/replica_range_lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import (
"github.com/cockroachdb/redact"
)

var transferExpirationLeasesFirstEnabled = settings.RegisterBoolSetting(
var TransferExpirationLeasesFirstEnabled = settings.RegisterBoolSetting(
settings.SystemOnly,
"kv.transfer_expiration_leases_first.enabled",
"controls whether we transfer expiration-based leases that are later upgraded to epoch-based ones",
Expand Down Expand Up @@ -281,7 +281,7 @@ func (p *pendingLeaseRequest) InitOrJoinRequest(

if p.repl.shouldUseExpirationLeaseRLocked() ||
(transfer &&
transferExpirationLeasesFirstEnabled.Get(&p.repl.store.ClusterSettings().SV) &&
TransferExpirationLeasesFirstEnabled.Get(&p.repl.store.ClusterSettings().SV) &&
p.repl.store.ClusterSettings().Version.IsActive(ctx, clusterversion.TODODelete_V22_2EnableLeaseUpgrade)) {
// In addition to ranges that should be using expiration-based leases
// (typically the meta and liveness ranges), we also use them during lease
Expand Down

0 comments on commit 6153b91

Please sign in to comment.