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
sql: creating new system tables with sqlmigrations
is not possible
#59850
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
Comments
ajwerner
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
Feb 5, 2021
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
Feb 7, 2021
This commit adds a table, `system.long_running_migrations`, to store the completion status of long-running migrations. This table is used to ensure safety and isolation in the face of concurrent attempts to upgrade the cluster version. An important facet of this change is the migration to add this table to the cluster during upgrades. Given that the implementation of long-running migrations relies on the table's existence, all versions which are associated with long-running migrations must follow the version which introduces this table. This migration needs to utilize the new infrastructure rather than the `sqlmigrations` infrastructure because of some really bad behavior introduced in 20.2 (cockroachdb#59850). Given two such versions already existed, they have been assigned new version keys and their old version keys and values are now merely placeholders. This provides comptability with the earlier alphas. Release note: None
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
Feb 9, 2021
This commit adds a table, `system.long_running_migrations`, to store the completion status of long-running migrations. This table is used to ensure safety and isolation in the face of concurrent attempts to upgrade the cluster version. An important facet of this change is the migration to add this table to the cluster during upgrades. Given that the implementation of long-running migrations relies on the table's existence, all versions which are associated with long-running migrations must follow the version which introduces this table. This migration needs to utilize the new infrastructure rather than the `sqlmigrations` infrastructure because of some really bad behavior introduced in 20.2 (cockroachdb#59850). Given two such versions already existed, they have been assigned new version keys and their old version keys and values are now merely placeholders. This provides comptability with the earlier alphas. Release note: None
I've reworked #59760 around this. You can create system tables inside of long-running migrations which we now have. I've gotten to the point that I think this should be the last release for the |
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
Feb 9, 2021
This commit adds a table, `system.long_running_migrations`, to store the completion status of long-running migrations. This table is used to ensure safety and isolation in the face of concurrent attempts to upgrade the cluster version. An important facet of this change is the migration to add this table to the cluster during upgrades. Given that the implementation of long-running migrations relies on the table's existence, all versions which are associated with long-running migrations must follow the version which introduces this table. This migration needs to utilize the new infrastructure rather than the `sqlmigrations` infrastructure because of some really bad behavior introduced in 20.2 (cockroachdb#59850). Given two such versions already existed, they have been assigned new version keys and their old version keys and values are now merely placeholders. This provides comptability with the earlier alphas. Release note: None
ajwerner
added a commit
to ajwerner/cockroach
that referenced
this issue
Feb 10, 2021
This commit adds a table, `system.migrations`, to store the completion status of long-running migrations. This table is used to ensure safety and isolation in the face of concurrent attempts to upgrade the cluster version. An important facet of this change is the migration to add this table to the cluster during upgrades. Given that the implementation of long-running migrations relies on the table's existence, all versions which are associated with long-running migrations must follow the version which introduces this table. This migration needs to utilize the new infrastructure rather than the `sqlmigrations` infrastructure because of some really bad behavior introduced in 20.2 (cockroachdb#59850). Given two such versions already existed, they have been assigned new version keys and their old version keys and values are now merely placeholders. This provides comptability with the earlier alphas. Release note: None
ajwerner
changed the title
sql: creating new system tables with
sql: creating new system tables with Feb 16, 2021
sqlmigrations
is no possiblesqlmigrations
is not possible
It seems like this should be closed. |
exalate-issue-sync
bot
added
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
and removed
T-sql-schema-deprecated
Use T-sql-foundations instead
labels
May 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Describe the problem
I think we may have very badly shot ourselves in the foot in a way I would not have anticipated. I'm feeling sad about it. We added validation all over the place in 20.2, as we well know. One of the key places where we added this validation was in virtual tables. One interesting thing that happens in validation is here. We check that the system tables have some privileges in some map. Unfortunately, that means that when adding new system tables, in the mixed version state, they will fail validation. This is a tough nut to crack. It means that, at least for 21.1, we can't add new system tables during
sqlmigrations
. I can work around this for my current use case but this is really unfortunate in general. I'm not sure how best to test this sort of thing.To Reproduce
Attempt to add a new system table and then in the mixed version state, run
SHOW TABLES
or something like it.Expected behavior
We can create new system tables and the mixed-version state will work.
Additional Context
Maybe this isn't actually too terrible. In 21.1 we have long-running migrations which only run after all nodes are on the new version. That means we can safely add tables there. The only really awkward part is the migration to bootstrap the infrastructure for long-running migrations.
The text was updated successfully, but these errors were encountered: