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: bump binaryMinSupportedVersion to 23.1, allowing 22.2 for testing #111500

Closed
wants to merge 1 commit into from

Conversation

rail
Copy link
Member

@rail rail commented Sep 29, 2023

Previously, we used the same minimum version for production upgrades and testing. In 23.2 we will be able to upgrade from 22.2, but this is not yet a stable feature.

This PR bumps the default version used for tests to 23.1, allowing using 22.2 if the COCKROACH_ALLOW_VERSION_SKIPPING environment variable is set to true.

Fixes: RE-477
Release note: None

@rail rail added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-testing Testing tools and infrastructure T-release Release Engineering & Automation Team labels Sep 29, 2023
@rail rail requested a review from celiala September 29, 2023 14:23
@rail rail self-assigned this Sep 29, 2023
@blathers-crl
Copy link

blathers-crl bot commented Sep 29, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rail rail changed the title clusterversion: bump binaryMinSupportedVersion to 23.1, allowing 22.2… clusterversion: bump binaryMinSupportedVersion to 23.1, allowing 22.2 for testing Sep 29, 2023
@rail
Copy link
Member Author

rail commented Sep 29, 2023

Looks like this affects test logic in some places. 🤔

@rail rail force-pushed the version-skipping-2 branch from c820ed7 to 4cfe92c Compare October 3, 2023 13:37
… for testing

Previously, we used the same minimum version for production upgrades and
testing. In 23.2 we will be able to upgrade from 22.2, but this is not
yet a stable feature.

This PR bumps the default version used for tests to 23.1, allowing
using 22.2 if the `COCKROACH_ALLOW_VERSION_SKIPPING` environment
variable is set to true.

Fixes: RE-477
Release note: None
@rail rail force-pushed the version-skipping-2 branch from 4cfe92c to c67dd53 Compare October 3, 2023 18:29
@rail rail requested a review from a team as a code owner October 3, 2023 18:29
@rail rail requested a review from sumeerbhola October 3, 2023 18:29
@RaduBerinde RaduBerinde requested a review from knz October 3, 2023 18:56
Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, most of the code should look exactly like we allow using 22.2 non-experimentally. There should only be one override in the cockroach binary initialization that bumps it to 23.1 for production.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @celiala, @knz, @rail, and @sumeerbhola)


pkg/clusterversion/cockroach_versions.go line 911 at r1 (raw file):

	// an error. This typically trails the current release by one (see top-level
	// comment).
	// Note: this variable is used for tests, and it is not the source of truth.

Is this really only used for tests? It's used in MakeVersionHandle which is production, no?

In any case, if we bump the tests to use 23.1, any 22.2 -> 23.2 paths will not be tested, why would we want to do that?

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @celiala, @knz, @rail, and @sumeerbhola)


pkg/clusterversion/cockroach_versions.go line 905 at r1 (raw file):

// separate concepts.
var (
	TestingBinaryMinSupportedVersionKey = V23_1

All the logic and concepts explained here are already pretty hard to understand. Now we're adding a key that gets rewritten based on an env var in init(). This kind of stuff should be done during initialization, not in init().

I think it would help to have two separate concepts:

  • the min supported version - the one that the code is supposed to support. This stays 22.2
  • the min allowed version - the one that we are confident it is stable. This is 22.2 or 23.1 depending on flags. This concept can be restricted to the cockroach binary initialization and doesn't need to be here.

@RaduBerinde RaduBerinde requested a review from dt October 3, 2023 19:02
@rail
Copy link
Member Author

rail commented Oct 3, 2023

FTR, I'm still experimenting (i.e. learning this part of the code ;) ) and open for all kind suggestions.

@RaduBerinde
Copy link
Member

I added @knz and @dt too as they may have some good ideas about how to do this in the cleanest way possible.

Copy link
Member

@dt dt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I suggested this change originally -- keeping BinaryMinSupportedVersionKey set to 22.2 until 23.2 was out to go though the motions of having a year old BinaryMinSupportedVersionKey, since that's what we'll be doing in 24.1 when it is 23.1.

That said, I'm sympathetic to Radu's argument that this is making a complicated and subtle part of the system more complicated (albeit just for one release), so I could also see walking away from this idea and just bumping it to the constant v23_1: we already went through majority of the development cycle with it set to 22_2, so we've already go through most of the motions of keeping year-old gates and compatibility around for a year, so I won't be heartbroken if we bumped it now with a simple constant.

@@ -472,7 +472,7 @@ var LogicTestConfigs = []TestClusterConfig{
Name: "local-mixed-22.2-23.1",
NumNodes: 1,
OverrideDistSQLMode: "off",
BootstrapVersion: clusterversion.V22_2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to change this: I think this config is explicitly labeled as 22.2-23.1 so it should be skipped / deleted when we drop 22.2 interop, rather than run against 23.1 instead, right?

@@ -124,6 +124,9 @@ func TestRangeFeed(t *testing.T) {
}

func TestMigrationCache(t *testing.T) {
if clusterversion.ByKey(clusterversion.V23_1).LessEq(clusterversion.TestingBinaryMinSupportedVersion) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I personally might find this easier to read as if clusterversion.V22_2 < clusterversion.BinaryMinSupportedVersionKey { t.Skip("test of 22.2 interop not applicable")}

@@ -902,21 +902,33 @@ const (
// feels out of place. A "cluster version" and a "binary version" are two
// separate concepts.
var (
TestingBinaryMinSupportedVersionKey = V23_1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do want to go with the env-var approach, I might suggest rather than introducing a new "AllowVersionSkipping" var and more variables and conditionals, we just use an anon-function to set BinaryMinSupportedVersionKey, e.g.

var BinaryMinSupportedVersionKey = func() Key { 
  if envutil("COCKROACH_UNSAFE_22_2_COMPAT") { return V22_2} 
  return V23_1
}()

Since this is a one-time thing for this release, we'd delete it as soon as the branch is cut (and just go back to = V23_1, so I'd just minimize the blast radius to how we set that one var.

@rail
Copy link
Member Author

rail commented Oct 4, 2023

I filed #111760 as an alternative to this solution. Draft PRs will be available soon.

@celiala
Copy link
Collaborator

celiala commented Oct 10, 2023

[For visibility] the REA team discussed everything raise here so far last week, and decided to remove version skipping support for 22.2 → 23.2:

i.e. we will set minBinary=V23_1 for release-23.2 (backporting as needed before the beta.1).

Reference:

@rail rail closed this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Testing tools and infrastructure C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-release Release Engineering & Automation Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants