Skip to content

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

@ajwerner

Description

@ajwerner

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

Epic CRDB-60938

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-schema-changer-implRelated to the implementation of the new schema changerA-testingTesting tools and infrastructureC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions