Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv: promote expiration-based lease to epoch without sequence number change #117840

Merged
merged 3 commits into from
Jan 19, 2024

Commits on Jan 16, 2024

  1. roachpb: improve TestLeaseEquivalence

    Test changes to just the leaseholder or just the start time, instead of
    both at the same time. This ensures that either lead to a sequence
    number change.
    
    Epic: None
    Release note: None
    nvanbenschoten committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    434178a View commit details
    Browse the repository at this point in the history
  2. batcheval: consolidate read summary construction in evalNewLease

    This commit is a small refactor so that we can eliminate the second
    call to Lease.Equivalent in RequestLease. There is already one in
    evalNewLease which is shared between RequestLease and TransferLease.
    
    Epic: None
    Release note: None
    nvanbenschoten committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    f46f8e9 View commit details
    Browse the repository at this point in the history
  3. kv: promote expiration-based lease to epoch without sequence number c…

    …hange
    
    Fixes cockroachdb#117630.
    Fixes cockroachdb#90656.
    Fixes cockroachdb#98553.
    
    Informs cockroachdb#61986.
    Informs cockroachdb#115191.
    
    This commit updates the post-lease transfer promotion of expiration-based leases
    to epoch-based leases to not change the sequence number of the lease. This
    avoids invalidating all requests proposed under the original expiration-based
    lease, which can lead to `RETRY_ASYNC_WRITE_FAILURE` errors.
    
    The change accomplishes this by updating the `Lease.Equivalent` method to
    consider an expiration-based lease to be equivalent to an epoch-based lease that
    is held by the same replica and has the same start time. Doing so requires some
    care, because lease equivalency is checked below Raft and needs to remain
    deterministic across binary versions.
    
    This change requires a cluster version check, so it cannot be backported.
    
    Release note (bug fix): Improved an interaction during range lease transfers
    which could previously cause `RETRY_ASYNC_WRITE_FAILURE` errors to be returned
    to clients.
    nvanbenschoten committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    54ebbac View commit details
    Browse the repository at this point in the history