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,sql: remove old cluster versions corresponding to 20.2 and 21.1 #67822

Merged
merged 17 commits into from
Jul 28, 2021

Conversation

postamar
Copy link
Contributor

@postamar postamar commented Jul 20, 2021

This pull request removes all old cluster versions corresponding to 20.2 and 21.1 which fall under the SQL group's responsibility.

Fixes #66546.

See #66546 and #65200 for an exhaustive (and possibly exhausting) list.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@postamar postamar force-pushed the 66546 branch 2 times, most recently from 75b8389 to e3bbd7a Compare July 20, 2021 21:33
@postamar postamar marked this pull request as ready for review July 20, 2021 21:33
@postamar postamar requested review from a team and adityamaru and removed request for a team July 20, 2021 21:34
@postamar
Copy link
Contributor Author

This PR is best reviewed commit-by-commit.

Note: you'll notice a ccl: remove local-mixed-20.2-21.1 logic tests commit. This was necessary for removing both ImplicitColumnPartitioning and MultiRegionFeatures. I could squash these three commits into one if anyone cares. I'm operating under the assumption that we don't care about mixed 20.2/21.1 tests at this point in master.

@postamar
Copy link
Contributor Author

The bazel CI failure seems like it can be ignored. It's complaining about a timeout. I ran the bazel test locally and it succeeded after 507 seconds so I'm guessing that the threshold in the CI is a bit low or something.

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

LGTM with a few comments

Comment on lines 287 to 282
includedInBootstrap: clusterversion.ByKey(clusterversion.AlterColumnTypeGeneral),
// This migration does not have a dedicated cluster version key but was
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you get to just remove the workFn here; this migration is "baked in" so to speak.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I originally left this in because if I didn't some backup tests would fail, complaining that system.tenants doesn't exist. Among other tests, TestPaginatedBackupTenant.

I've looked into this some more and now think I surfaced an unrelated bug. In the bootstrap package, system.tenants gets created only if this is the system tenant. However the migration doesn't seem to care about this. Case in point if I change the current diff to add if !r.codec.ForSystemTenant() { return nil } to createTenantsTable the test fails.

Copy link
Contributor Author

@postamar postamar Jul 27, 2021

Choose a reason for hiding this comment

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

The other test with problems was TestBackupRestoreInsideTenant/tenant-backup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I came up with what I believe to be an acceptable fix in that in backup_planning.go I wrap the query to system.tenants in if p.ExecCfg().Codec.ForSystemTenant() { ... } which should be a no-op, AFAIK the table is empty for non-system tenants. Like I said it probably shouldn't even exist in those cases, yet it does in these backup tests. Is this an artifact of how we set up those test clusters or a real bug in the startupmigrations? I still haven't been able to tell.

@@ -97,7 +97,7 @@ message SequenceDependency {
// For example, nextval('foo.public.seq') vs. nextval(12345::REGCLASS),
// where 12345 is the ID of foo.public.seq.
// Sequences referenced only by its ID have the ability to be renamed.
bool by_id = 5 [(gogoproto.customname) = "ByID"];
reserved 5; // This field was used until 21.2.
Copy link
Contributor

Choose a reason for hiding this comment

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

We've never actually stored these things, so part of me thinks we can just nix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

// All versions which have a registered long-running migration must have a
// version higher than this version.
LongRunningMigrations
deletedLongRunningMigrations
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just delete these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't remember why, now I don't see why not, so: will do.

Marius Posta added 17 commits July 27, 2021 11:49
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
The code covered by these tests is exercised in mixed-version clusters
with 20.2 and 21.1 nodes, as the name of the test suite implies. These
are no longer relevant at this stage of the 21.2 release cycle.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
Partially addresses cockroachdb#66546 by removing a cluster version and its
associated dependencies which, for any cluster whose version is at
least 21.1, is certain to be active.

Release note: None
@postamar postamar requested a review from a team as a code owner July 27, 2021 20:48
Copy link
Contributor

@ajwerner ajwerner 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 2 of 3 files at r28, 1 of 9 files at r32, 2 of 6 files at r33.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @ajwerner, and @postamar)

@tbg tbg removed the request for review from a team July 28, 2021 06:53
@postamar
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 28, 2021

Build succeeded:

@craig craig bot merged commit f5a630c into cockroachdb:master Jul 28, 2021
@postamar postamar deleted the 66546 branch July 28, 2021 14:41
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.

clusterversion,sql: remove old cluster versions corresponding to 20.2 and 21.1
3 participants