Skip to content

sql/schemachanger: version gate element creation#86774

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
ajwerner:ajwerner/element-min-version
Sep 8, 2022
Merged

sql/schemachanger: version gate element creation#86774
craig[bot] merged 2 commits intocockroachdb:masterfrom
ajwerner:ajwerner/element-min-version

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

@ajwerner ajwerner commented Aug 24, 2022

Commit 1: fix minSupportedVersion of ADD COLUMN in new schema changer
from v22.1 to v22.2
Commit 2: We cannot create elements the old version of the code does not know about.

Release justification: fixed mixed version incompatibility
Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

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.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/sql/schemachanger/scbuild/build.go line 101 at r1 (raw file):

		// Exclude targets which are not yet usable in the currently active
		// cluster version.
		if !version.IsActive(screl.MinVersion(e.element)) {

Are there any concerns about funny side effects because of missing elements and transactions? We tend to stack states together when multiple statements are used.

@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Sep 1, 2022

Are there any concerns about funny side effects because of missing elements and transactions? We tend to stack states together when multiple statements are used.

We don't really support using the declarative schema changer in explicit transactions officially, and we don't support any statements where that is interesting in the mixed version state, so I'm not worried about it.

@ajwerner ajwerner marked this pull request as ready for review September 1, 2022 15:04
@ajwerner ajwerner requested a review from a team September 1, 2022 15:04
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.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)

@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Sep 1, 2022

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 1, 2022

Build failed (retrying...):

@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Sep 1, 2022

bors r-

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 1, 2022

Canceled.

@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Sep 1, 2022

Will fix #86659

@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Sep 6, 2022

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 6, 2022

Build failed (retrying...):

@ajwerner
Copy link
Copy Markdown
Contributor Author

ajwerner commented Sep 6, 2022

bors r-

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 6, 2022

Canceled.

@Xiang-Gu Xiang-Gu force-pushed the ajwerner/element-min-version branch from 39764bf to 945c80d Compare September 7, 2022 20:36
@Xiang-Gu
Copy link
Copy Markdown
Contributor

Xiang-Gu commented Sep 7, 2022

Once #87459 is merged into master, I will rid it (commit 1) from this PR. After that we should be able to bors it.

@ajwerner ajwerner force-pushed the ajwerner/element-min-version branch from 945c80d to b736df1 Compare September 8, 2022 04:58
Xiang-Gu and others added 2 commits September 8, 2022 10:09
Previously, the minimal supported version for stmt `ADD COLUMN` in the
new schema changer was incorrectly labeled as v22.1, but this stmt was
not fully supported and we added much functionality to it in v22.2.
It was incompatible with the version gating elements commit (e.g.
in a mixed version state, if we want to use new schema changer for an
`ADD COLUMN` but the element `IndexColumn` was excluded due to the
gating, then we will run into issues). This PR changes the minimal
supported version of `ADD COLUMN` to v22.2.

Release justification: bug fix

Release note: None
We cannot create elements the old version of the code does not know about.

Release justification: fixed mixed version incompatibility
Release note: None
@Xiang-Gu Xiang-Gu force-pushed the ajwerner/element-min-version branch from b736df1 to 7dbf545 Compare September 8, 2022 14:14
@Xiang-Gu
Copy link
Copy Markdown
Contributor

Xiang-Gu commented Sep 8, 2022

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 8, 2022

Build succeeded:

@craig craig bot merged commit ce55e1b into cockroachdb:master Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants