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: introduce a Raft-based transport for closedts #59566

Merged
merged 2 commits into from
Feb 20, 2021

Commits on Feb 20, 2021

  1. kvserver: introduce a Raft-based transport for closedts

    This patch introduces a replacement for the existing closed timestamp
    mechanism / transport. The new mechanism is gated by a cluster version.
    
    Raft commands now carry increasing closed timestamps generated by the
    propBuf by using the recent request Tracker for synchronizing with
    in-flight requests (i.e. not closing timestamps below them).
    Raft commands get a closed ts field, and the range state gets the field
    as well.
    
    The propBuf pays attention to the range's closed timestamp policy for
    deciding whether to close lagging or leading timestamps.
    
    Fixes cockroachdb#57395, cockroachdb#57396
    Touches cockroachdb#57405
    
    Release note: None
    andreimatei committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    0668efb View commit details
    Browse the repository at this point in the history
  2. kvserver: reset tscache after merge to closed ts

    This patch deals with what happens to the RHS's timestamp cache on a
    merge. Before this patch, we were either not touching the cache at all,
    when the leases of the LHS and RHS were collocated at merge time, or we
    were bumping the RHS's ts cache up to the freeze point otherwise
    (because, in this case, the RHS's ts cache info has been lost).  This
    patch goes further: now we'll bump the RHS ts cache up to the RHS closed
    timestamp on the argument the the RHS's closed timestamp is lost.
    
    This patch is needed by the effort to move closed timestamp to be
    per-range instead of per-store, and also to have future-time closed
    timestamps. Today, the new ts cache bump is not necessary for a fairly
    subtle reason: if the pre-merge leases are collocated,, then the closed
    ts of the RHS is not "lost" because it's the same as the one of the LHS.
    If the leases are not collocated, the freeze time of the RHS is
    certainly above its closed ts. So, in either case, the current code
    doesn't lead to the possibility of accepting write post-merge that
    invalidate previous follower reads.
    
    The RHS' closed timestamp is plumbed from the freeze to the merge
    through subsume response.
    
    Release note: None
    andreimatei committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    8738d72 View commit details
    Browse the repository at this point in the history