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: remove cycle DepEdge rules, add SameStage kind #73290

Merged
merged 6 commits into from
Nov 30, 2021

Conversation

ajwerner
Copy link
Contributor

First few commits are mostly minor cleanup. Last commit is the meat of the change.

This commit seeks to rectify an early mistake in the architecture of the
declarative schema changer. In the original design, we knew we wanted certain
transitions to happen in the same stage. In order to deal with that, we created
rules that allowed for special types of cycles in dependencies to exist. This
was a mistake. Instead, we replace this by a Kind property of DepEdges
which indicates whether the target pointed to merely needs to HappenBefore
or whether it also needs to happen in the SameStage. This allows us to
express exactly what we meant.

This change also uncovered some broken cycles which never were intended to
exist. The resultant plans generally look better.

Release note: None

Just pulling symbols into the test and making the table a bit more explicit.

Release note: None
This commit seeks to rectify an early mistake in the architecture of the
declarative schema changer. In the original design, we knew we wanted certain
transitions to happen in the same stage. In order to deal with that, we created
rules that allowed for special types of cycles in dependencies to exist. This
was a mistake. Instead, we replace this by a `Kind` property of `DepEdge`s
which indicates whether the target pointed to merely needs to `HappenBefore`
or whether it also needs to happen in the `SameStage`. This allows us to
express exactly what we meant.

This change also uncovered some broken cycles which never were intended to
exist. The resultant plans generally look better.

Release note: None
@ajwerner ajwerner requested a review from a team November 30, 2021 01:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@postamar postamar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo making the DepEdgeKind show up in scgraphviz renderings. Perhaps use a double-headed arrow for those edges?

Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: definitely much cleaner.

Reviewed 6 of 6 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 3 of 3 files at r4, 2 of 2 files at r5, 19 of 19 files at r6, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)

@ajwerner
Copy link
Contributor Author

TFTR

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 30, 2021

Build succeeded:

@craig craig bot merged commit 3d2e539 into cockroachdb:master Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants