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

sql/schemachanger: catalog dep and op rule usages #82902

Open
ajwerner opened this issue Jun 14, 2022 · 1 comment
Open

sql/schemachanger: catalog dep and op rule usages #82902

ajwerner opened this issue Jun 14, 2022 · 1 comment
Labels
A-schema-changer-impl Related to the implementation of the new schema changer A-testing Testing tools and infrastructure C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@ajwerner
Copy link
Contributor

ajwerner commented Jun 14, 2022

Is your feature request related to a problem? Please describe.

The dependency and op rules are critically important for the correctness of schema changes. They are also often hard to understand because they act at such a distance. We should feel like we confidently know that we have cases where individual rules fire.

Describe the solution you'd like
We should write a test which catalogs when a given dep rule kicks in. One simple way to do this is to record the usages just from the existing datadriven schema change tests.

Describe alternatives you've considered
In #82643 we ask to record the states from the plans of all schema changes in datadriven tests. This would be an even better catalog than the schemachanger tests.

Another note is that some rules might only kick in when reverting. We can use the rollback end-to-end tests to capture that. It's a little bit sad that we don't get nice datadriven test outputs for the sequence of changes for each of the possible rollbacks for a schema change. That could be a good addition.

Another related ask is to make sure we can visualize the rules. It'd be interesting to try to synthesize schema changes which trigger all of the rules firing. This graph might get very large. We probably need to improve our visualization technology.

We should include clearer commentary on when a rule is relevant. Right now we sometimes have paragraphs which are confusing and other times we have effectively no commentary at all. We need better toolkits to talk about rules.

Jira issue: CRDB-16720

@ajwerner ajwerner added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-schema-deprecated Use T-sql-foundations instead labels Jun 14, 2022
@ajwerner
Copy link
Contributor Author

This aligns with having one test per file strategy we've been talking about.

@postamar postamar added C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. A-testing Testing tools and infrastructure A-schema-changer-impl Related to the implementation of the new schema changer and removed C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Nov 10, 2022
@exalate-issue-sync 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
A-schema-changer-impl Related to the implementation of the new schema changer A-testing Testing tools and infrastructure C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants