Skip to content

Commit

Permalink
clusterversion: remove Start21_1 (no longer applicable)
Browse files Browse the repository at this point in the history
Fixes cockroachdb#65200. The last remaining 21.1 version (V21_1) can be removed as
part of cockroachdb#69828.

Release note: None
  • Loading branch information
irfansharif committed Sep 15, 2021
1 parent 1f98510 commit 887e84a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 61 deletions.
17 changes: 7 additions & 10 deletions pkg/clusterversion/cockroach_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,8 @@ const (
_ Key = iota - 1 // want first named one to start at zero

// v21.1 versions.
//
// Start21_1 demarcates work towards CockroachDB v21.1.
Start21_1
// V21_1 is CockroachDB v21.1. It's used for all v21.1.x patch releases.
// TODO(irfansharif): This can be removed as part of once #69828 lands (bumping the min cluster version.
V21_1

// v21.1PLUS release. This is a special v21.1.x release with extra changes,
Expand Down Expand Up @@ -251,6 +249,7 @@ const (
// PebbleFormatVersioned ratchets Pebble's format major version to
// the version FormatVersioned.
PebbleFormatVersioned

// *************************************************
// Step (1): Add new versions here.
// Do not add new versions to a patch release.
Expand All @@ -275,18 +274,15 @@ const (
// minor version until we are absolutely sure that no new migrations will need
// to be added (i.e., when cutting the final release candidate).
var versionsSingleton = keyedVersions{

// v21.1 versions. Internal versions defined here-on-forth must be even.
{
Key: Start21_1,
Version: roachpb.Version{Major: 20, Minor: 2, Internal: 2},
},
// v21.1 versions.
{
// V21_1 is CockroachDB v21.1. It's used for all v21.1.x patch releases.
Key: V21_1,
Version: roachpb.Version{Major: 21, Minor: 1},
},

// Internal versions must be even.

// v21.1PLUS version. This is a special v21.1.x release with extra changes,
// used internally for the 2021 Serverless offering.
//
Expand Down Expand Up @@ -436,7 +432,8 @@ var (
// binaryMinSupportedVersion is the earliest version of data supported by
// this binary. If this binary is started using a store marked with an older
// version than binaryMinSupportedVersion, then the binary will exit with
// an error.
// an error. This typically trails the current release by one (see top-level
// comment).
binaryMinSupportedVersion = ByKey(V21_1)

// binaryVersion is the version of this binary.
Expand Down
71 changes: 35 additions & 36 deletions pkg/clusterversion/key_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions pkg/sql/set_cluster_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,21 +403,6 @@ func runVersionUpgradeHook(
targetVersionStr := string(*value.(*tree.DString))
to.Version = roachpb.MustParseVersion(targetVersionStr)

start21_1 := clusterversion.ByKey(clusterversion.Start21_1)
if !params.extendedEvalCtx.Codec.ForSystemTenant() && from.Less(start21_1) {

// In the case that we're setting the cluster version to something that
// precedes the start of 21.1, which is permitted, if only because it's
// complex to prevent, then there's definitely no migrations to run and
// it may be hazardous due to assumptions about versions being even.
if to.Less(start21_1) {
return nil
}
// Otherwise, tell the migration layer that we're starting from the lowest
// allowable version.
from.Version = start21_1
}

// toSettingString already validated the input, and checked to
// see that we are allowed to transition. Let's call into our
// upgrade hook to run migrations, if any.
Expand Down

0 comments on commit 887e84a

Please sign in to comment.