Skip to content

Commit

Permalink
kvserver: disable kv.expiration_leases_only.enabled metamorphism un…
Browse files Browse the repository at this point in the history
…der deadlock

TestClusters are usually so slow under deadlock detection that they're
unable to maintain leases/leadership/liveness, especially with
expiration leases.

Epic: none
Release note: None
  • Loading branch information
erikgrinaker committed Apr 28, 2023
1 parent 3b1bc87 commit f63ec0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kv/kvserver/replica_range_lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/retry"
"github.com/cockroachdb/cockroach/pkg/util/stop"
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/cockroach/pkg/util/tracing"
"github.com/cockroachdb/errors"
Expand All @@ -81,7 +82,11 @@ var ExpirationLeasesOnly = settings.RegisterBoolSetting(
settings.SystemOnly,
"kv.expiration_leases_only.enabled",
"only use expiration-based leases, never epoch-based ones (experimental, affects performance)",
util.ConstantWithMetamorphicTestBool("kv.expiration_leases_only.enabled", false),
// false by default. Metamorphically enabled in tests, but not in deadlock
// builds because TestClusters are usually so slow that they're unable
// to maintain leases/leadership/liveness.
!syncutil.DeadlockEnabled &&
util.ConstantWithMetamorphicTestBool("kv.expiration_leases_only.enabled", false),
)

var leaseStatusLogLimiter = func() *log.EveryN {
Expand Down

0 comments on commit f63ec0e

Please sign in to comment.