Skip to content

*: delete old version gates#111396

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
healthy-pod:remove-old-version-gates
Sep 29, 2023
Merged

*: delete old version gates#111396
craig[bot] merged 1 commit intocockroachdb:masterfrom
healthy-pod:remove-old-version-gates

Conversation

@healthy-pod
Copy link
Copy Markdown
Contributor

@healthy-pod healthy-pod commented Sep 28, 2023

Release note: None
Epic: none

Fixes #96762
Fixes #96761
Fixes #96765

@healthy-pod healthy-pod requested a review from a team as a code owner September 28, 2023 00:28
@healthy-pod healthy-pod requested a review from a team September 28, 2023 00:28
@healthy-pod healthy-pod requested review from a team as code owners September 28, 2023 00:28
@healthy-pod healthy-pod requested review from lidorcarmel, miretskiy and yuzefovich and removed request for a team September 28, 2023 00:29
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@healthy-pod healthy-pod force-pushed the remove-old-version-gates branch from f353955 to 5438146 Compare September 28, 2023 01:31
Copy link
Copy Markdown
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 28 of 28 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @healthy-pod, @lidorcarmel, and @miretskiy)


pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go line 206 at r1 (raw file):

}

var isV221Active = func(_ tree.NodeFormatter, _ sessiondatapb.NewSchemaChangerMode, activeVersion clusterversion.ClusterVersion) bool {

nit: I think we can remove isV221Active altogether - it's ok for checks to be nil.

@healthy-pod healthy-pod force-pushed the remove-old-version-gates branch 3 times, most recently from 220a7f9 to 8b4db22 Compare September 28, 2023 01:55
Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewed 27 of 28 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @lidorcarmel, and @miretskiy)


pkg/clusterversion/cockroach_versions.go line 219 at r2 (raw file):

	// TODODelete_V22_2SetSystemUsersUserIDColumnNotNull sets the user_id column in system.users to not null.
	TODODelete_V22_2SetSystemUsersUserIDColumnNotNull
	// Permanent_V22_2SQLSchemaTelemetryScheduledJobs adds an automatic schedule for SQL schema

Maybe keep the full comment for this one.

@RaduBerinde
Copy link
Copy Markdown
Member

There are some open issues around this, listed under 4 here: #95530

Can you mark this PR as fixing them?

Copy link
Copy Markdown
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.

:lgtm_strong:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @lidorcarmel, and @miretskiy)


pkg/clusterversion/cockroach_versions.go line 180 at r2 (raw file):

	//
	// This is a permanent migration which should exist forever.
	Permanent_V22_2SQLSchemaTelemetryScheduledJobs

Maybe we want to move this to a "Primordial" version? (feels like this is what they are for, but I'm not exactly sure)


pkg/sql/schemachanger/screl/scalars.go line 106 at r2 (raw file):

// VersionSupportsElementUse checks if an element may be used at a given version.
func VersionSupportsElementUse(el scpb.Element, version clusterversion.ClusterVersion) bool {

Nice refactoring!


pkg/sql/schemachanger/screl/scalars.go line 124 at r2 (raw file):

		// These elements need v22.1 so they can be used without checking any version gates.
		return true
	case *scpb.CompositeType, *scpb.CompositeTypeAttrType, *scpb.CompositeTypeAttrName:

[nit] these cases can be consolidated and sorted by version

Copy link
Copy Markdown
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! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @lidorcarmel, and @miretskiy)


pkg/clusterversion/cockroach_versions.go line 171 at r2 (raw file):

	VPrimordial5
	VPrimordial6
	// NOTE(andrei): Do not introduce new upgrades corresponding to VPrimordial

@knz do you understand this comment? My current guess is that it says to not introduce upgrades tied to an existing VPrimordialX version, and that we should instead add a new version?

It feels that all permanent upgrades would use one of these versions? Otherwise what is the point of "tying" a permanent upgrade to a dev version, if it is going to run no matter what?

Unfortunately Andrei and Andrew had the most context here I think :/


pkg/upgrade/upgrades/upgrades.go line 89 at r2 (raw file):

	),
	// Introduced in v2.1.
	// TODO(knz): bake this migration into v19.1.

I think we can remove this comment

@RaduBerinde
Copy link
Copy Markdown
Member

pkg/clusterversion/cockroach_versions.go line 171 at r2 (raw file):

Previously, RaduBerinde wrote…

@knz do you understand this comment? My current guess is that it says to not introduce upgrades tied to an existing VPrimordialX version, and that we should instead add a new version?

It feels that all permanent upgrades would use one of these versions? Otherwise what is the point of "tying" a permanent upgrade to a dev version, if it is going to run no matter what?

Unfortunately Andrei and Andrew had the most context here I think :/

I will reach out to Andrei and see if we can get some more clarity and improve these comments.

Copy link
Copy Markdown
Contributor

@knz knz 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! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @lidorcarmel, @miretskiy, and @RaduBerinde)


pkg/clusterversion/cockroach_versions.go line 171 at r2 (raw file):

Previously, RaduBerinde wrote…

I will reach out to Andrei and see if we can get some more clarity and improve these comments.

Without reversing this code, i don't feel comfortable reusing the VPrimordial versions for anything. We also didn't do it in the last release cycle.

@RaduBerinde
Copy link
Copy Markdown
Member

pkg/clusterversion/cockroach_versions.go line 171 at r2 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

Without reversing this code, i don't feel comfortable reusing the VPrimordial versions for anything. We also didn't do it in the last release cycle.

I spoke with Andrei for a bit and he agrees. I think the approach taken here is correct. I'll work on a separate PR to add to the comments.

Copy link
Copy Markdown
Collaborator

@celiala celiala left a comment

Choose a reason for hiding this comment

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

:lgtm:

There are some open issues around this, listed under 4 here: #95530
Can you mark this PR as fixing them?

Specifically:

Thank you!

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @knz, @lidorcarmel, @miretskiy, and @RaduBerinde)


pkg/clusterversion/cockroach_versions.go line 180 at r2 (raw file):

Previously, RaduBerinde wrote…

Maybe we want to move this to a "Primordial" version? (feels like this is what they are for, but I'm not exactly sure)

I'm not 100% sure how Primordial versions are used either tbh (compared to normal version gates).

At the very least, we should leave version value (order in which the system migrates though each gate). So perhaps we leave Permanent versions as-is (in the same order), unless others have more context/guidance here.

Copy link
Copy Markdown
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

SQL Foundations related files look good

Copy link
Copy Markdown
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @knz, @lidorcarmel, @miretskiy, and @RaduBerinde)

Release note: None
Epic: none
@healthy-pod healthy-pod force-pushed the remove-old-version-gates branch from 8b4db22 to 51a913b Compare September 28, 2023 19:24
@healthy-pod
Copy link
Copy Markdown
Contributor Author

TFTRs!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 29, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

8 participants