From f455bc3475b388f9b02e2951035194578a251505 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Wed, 18 Sep 2024 16:56:02 -0400 Subject: [PATCH] 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: #131102 Release note: None --- docs/generated/settings/settings-for-tenants.txt | 2 +- docs/generated/settings/settings.html | 2 +- pkg/clusterversion/cockroach_versions.go | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index 7c505a40b16e..ff7dad79a905 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -399,4 +399,4 @@ trace.snapshot.rate duration 0s if non-zero, interval at which background trace trace.span_registry.enabled boolean true if set, ongoing traces can be seen at https:///#/debug/tracez application trace.zipkin.collector string the address of a Zipkin instance to receive traces, as :. If no port is specified, 9411 will be used. application ui.display_timezone enumeration etc/utc the timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1] application -version version 1000024.2-upgrading-to-1000024.3-step-016 set the active cluster version in the format '.' application +version version 1000024.2-upgrading-to-1000024.3-step-020 set the active cluster version in the format '.' application diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index 978687cc54e2..af13f941e586 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -356,6 +356,6 @@
trace.span_registry.enabled
booleantrueif set, ongoing traces can be seen at https://<ui>/#/debug/tracezServerless/Dedicated/Self-Hosted
trace.zipkin.collector
stringthe address of a Zipkin instance to receive traces, as <host>:<port>. If no port is specified, 9411 will be used.Serverless/Dedicated/Self-Hosted
ui.display_timezone
enumerationetc/utcthe timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1]Serverless/Dedicated/Self-Hosted -
version
version1000024.2-upgrading-to-1000024.3-step-016set the active cluster version in the format '<major>.<minor>'Serverless/Dedicated/Self-Hosted +
version
version1000024.2-upgrading-to-1000024.3-step-020set the active cluster version in the format '<major>.<minor>'Serverless/Dedicated/Self-Hosted diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 098e0b8513d4..dc054f88d8a2 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -247,6 +247,15 @@ const ( // policies. V24_3_MaybePreventUpgradeForCoreLicenseDeprecation + // V24_3_UseRACV2WithV1EntryEncoding is the earliest version which supports + // ranges using replication flow control v2, still with v1 entry encoding. + V24_3_UseRACV2WithV1EntryEncoding + + // V24_3_UseRACV2Full is the earliest version which supports ranges using + // replication flow control v2, with v2 entry encoding. Replication flow + // control v1 is unsupported at this version. + V24_3_UseRACV2Full + // ************************************************* // Step (1) Add new versions above this comment. // Do not add new versions to a patch release. @@ -302,6 +311,8 @@ var versionTable = [numKeys]roachpb.Version{ V24_3_AdvanceCommitIndexViaMsgApps: {Major: 24, Minor: 2, Internal: 12}, V24_3_SQLInstancesAddDraining: {Major: 24, Minor: 2, Internal: 14}, V24_3_MaybePreventUpgradeForCoreLicenseDeprecation: {Major: 24, Minor: 2, Internal: 16}, + V24_3_UseRACV2WithV1EntryEncoding: {Major: 24, Minor: 2, Internal: 18}, + V24_3_UseRACV2Full: {Major: 24, Minor: 2, Internal: 20}, // ************************************************* // Step (2): Add new versions above this comment.