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

release-22.1: kvserver: check PROSCRIBED lease status over UNUSABLE #102597

Merged
merged 2 commits into from May 9, 2023

Commits on Apr 27, 2023

  1. kvserver: check PROSCRIBED lease status over UNUSABLE

    The PROSCRIBED lease status, just like EXPIRED, puts a lease to a definitely
    invalid state. The UNUSABLE state (when request timestamp is in stasis period)
    is less of a clear cut: we still own the lease but callers may use or not use
    it depending on context.
    
    For example, the closed timestamp side-transport ignores the UNUSABLE state
    (because we still own the lease), and takes it as usable for its purposes.
    Because of the order in which the checks were made, this has lead to a bug: a
    PROSCRIBED lease is reported as UNUSABLE during stasis periods, the closed
    timestamp side-transport then considers it usable, and updates closed
    timestamps when it shouldn't.
    
    This commit fixes the bug by swapping the order of checks in the leaseStatus
    method. The order now goes from "hard" checks like EXPIRED and PROSCRIBED, to
    "softer" UNUSABLE, and (when the softness is put to the limit) VALID.
    
    Fixes #98698
    Fixes #99931
    Fixes #100101
    Epic: none
    
    Release note (bug fix): a bug is fixed in closed timestamp updates within its
    side-transport. Previously, during asymmetric partitions, a node that transfers
    a lease away, and misses a liveness heartbeat, could then erroneously update
    the closed timestamp during the stasis period of its liveness. This could lead
    to closed timestamp invariant violation, and node crashes; in extreme cases
    this could lead to inconsistencies in read-only queries.
    pav-kv committed Apr 27, 2023
    Copy the full SHA
    ab8d6ad View commit details
    Browse the repository at this point in the history

Commits on May 9, 2023

  1. kvserver: add test for Replica.leaseStatus

    Epic: none
    Release note: none
    pav-kv committed May 9, 2023
    Copy the full SHA
    e6f0bdb View commit details
    Browse the repository at this point in the history