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

clusterversion: introduce rac2 cluster version gates #131106

Merged
merged 2 commits into from
Sep 24, 2024

Commits on Sep 20, 2024

  1. clusterversion: introduce rac2 cluster version gates

    Introduce two new cluster version gates:
    
    ```
    V24_3_UseRACV2WithV1EntryEncoding
    V24_3_UseRACV2Full
    ```
    
    Upon a range leader first encountering
    `V24_3_UseRACV2WithV1EntryEncoding` via `handleRaftReadyRaftMuLocked`,
    it will begin a new term using the replication flow control v2 protocol,
    creating a `RangeController` but continue using the v1 entry encoding
    and raft still operating in push mode.
    
    Upon a range leader first encountering `V24_3_UseRACV2Full`, it will continue
    using the replication flow control v2 protocol, but will now switch to
    using the V2 entry encoding.
    
    Note that the necessary protocol migration at the leader, (base) =>
    `V24_3_UseRACV2WithV1EntryEncoding` occurs before any other calls in
    `handleRaftReadyRaftMuLocked`.
    
    The two version gates are necessary to ensure there are never v2 encoded
    entries in the raft log while there is a possibility of a leader running
    v1.
    
    Resolves: cockroachdb#131102
    Release note: None
    kvoli committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    f455bc3 View commit details
    Browse the repository at this point in the history
  2. kvserver: move racv2 enabled level to kvflowcontrol and add test knob

    Move `EnabledWhenLeaderLevel` from `replica_rac2` to the parent package
    `kvflowcontrol` and rename `V2EnabledWhenLeaderLevel` to reflect the
    move to a shared v1/v2 package.
    
    Also move the corresponding function `racV2EnabledWhenLeaderLevel` to
    `kvflowcontrol`. `GetV2EnabledWhenLeaderLevel` will check if there are
    testing knob overrides for the enabled level, and if not continue
    returning `V2NotEnabledWhenLeader`. Some commentary and todos are also
    left around this function, for when we enable the protocol and
    separately, pull mode.
    
    Part of: cockroachdb#130187
    Release note: None
    kvoli committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    7cf9492 View commit details
    Browse the repository at this point in the history