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

kvserver: don't refuse to fwd lease proposals in some edge cases #58722

Merged
merged 3 commits into from
Jan 25, 2021

Commits on Jan 22, 2021

  1. kvserver: remove non-sensical assertion

    This assertion had become nonsensical in #9915f0d0f104aa918c94340e9e47129b90421999.
    It's from a time where the surrounding function was dealing with the
    local store only.
    
    Release note: None
    andreimatei committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    70b90af View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2021

  1. kvserver: reduce function deps

    Make checkCanReceiveLease() more nimble, anticipating broader use.
    
    Release note: None
    andreimatei committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    5332106 View commit details
    Browse the repository at this point in the history
  2. kvserver: don't refuse to fwd lease proposals in some edge cases

    This patch backpedals a little bit on the logic introduced in cockroachdb#55148.
    That patch said that, if a leader is known, every other replica refuses
    to propose a lease acquisition. Instead, the replica in question
    redirects whomever was triggering the lease acquisition to the leader,
    thinking that the leader should take the lease.
    That patch introduced a deadlock: some replicas refuse to take the lease
    because they are not VOTER_FULL (see CheckCanReceiveLease()). To fix the
    deadlock, this patch incorporates that check in the proposal buffer's
    decision about whether or not to reject a proposal: if the leader is
    believed to refuse to take the lease, then we again forward our own
    lease request.
    
    An edge case to the edge case is when the leader is not even part of the
    proposer's range descriptor. This can happen if the proposer is far
    behind. In this case, we assume that the leader is eligible. If it
    isn't, the deadlock will resolve once the proposer catches up.
    
    A future patch will relax the conditions under which a replica agrees to
    take the lease. VOTER_INCOMING replicas should take the lease.
    VOTER_DEMOTING are more controversial.
    
    Fixes cockroachdb#57798
    
    Release note: None
    andreimatei committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    a767cdd View commit details
    Browse the repository at this point in the history