cockroach
cockroach copied to clipboard
kvserver: always transfer expiration-based leases
Fixes #81764.
In addition to ranges that unconditionally require expiration-based leases (node liveness and earlier), we now also use them during lease transfers for all other ranges. After acquiring such expiration-based leases, the leaseholders are expected to soon upgrade them to the more efficient epoch-based ones. By transferring an expiration-based lease, we can limit the effect of an ill-advised lease transfer since the incoming leaseholder needs to recognize itself as such within a few seconds; if it doesn't (we accidentally sent the lease to a replica in need of a snapshot), the lease is up for grabs. If we simply transferred epoch based leases, it would be possible for the new leaseholder in need of a snapshot to maintain its lease if the node it was on is able to heartbeat its liveness record.
Release note: None.
(Gentle nudge, @nvanbenschoten)
bors r+