diff --git a/pkg/kv/kvserver/replica_range_lease.go b/pkg/kv/kvserver/replica_range_lease.go index 9590d440ed26..a47bbd4be7ff 100644 --- a/pkg/kv/kvserver/replica_range_lease.go +++ b/pkg/kv/kvserver/replica_range_lease.go @@ -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" @@ -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 {