-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Conversation
75b8389
to
e3bbd7a
Compare
This PR is best reviewed commit-by-commit. Note: you'll notice a |
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. |
There was a problem hiding this 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
pkg/startupmigrations/migrations.go
Outdated
includedInBootstrap: clusterversion.ByKey(clusterversion.AlterColumnTypeGeneral), | ||
// This migration does not have a dedicated cluster version key but was |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r28, 1 of 9 files at r32, 2 of 6 files at r33.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @ajwerner, and @postamar)
bors r+ |
Build succeeded: |
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.