sql/schemachanger: catalog dep and op rule usages #82902
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)
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
The text was updated successfully, but these errors were encountered: