cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

kvserver: always transfer expiration-based leases

Open irfansharif opened this issue 3 years ago • 1 comments
trafficstars

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.

irfansharif avatar Aug 04 '22 18:08 irfansharif

This change is Reviewable

cockroach-teamcity avatar Aug 04 '22 18:08 cockroach-teamcity

(Gentle nudge, @nvanbenschoten)

irfansharif avatar Aug 15 '22 21:08 irfansharif

bors r+

irfansharif avatar Aug 20 '22 19:08 irfansharif

Build succeeded:

craig[bot] avatar Aug 20 '22 20:08 craig[bot]