scpb and scplan refactor#74598
Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom Jan 10, 2022
Merged
Conversation
Member
811bb70 to
ec66c57
Compare
added 2 commits
January 10, 2022 09:10
This refactoring commit moves scpb.Node to screl and groups the targets into a new scpb.TargetState. Separating the quasi-constant target elements and statuses from the elements' intermediate statuses ultimately makes for cleaner code in the declarative schema changer. Release note: None
This commit moves scgraph and scgraphviz under scplan, and makes all its child packages internal. Release note: None
ec66c57 to
ed182ed
Compare
miretskiy
reviewed
Jan 10, 2022
| message NewSchemaChangeDetails { | ||
| repeated cockroach.sql.schemachanger.scpb.Target targets = 1; | ||
|
|
||
| cockroach.sql.schemachanger.scpb.TargetState target_state = 5 [(gogoproto.nullable) = false]; |
Contributor
There was a problem hiding this comment.
do we need to reserve 1,2,3?
Author
There was a problem hiding this comment.
No, these jobs don't exist yet out in the wild. We'll do a tag ID cleanup pass before the release, this is liable to change again until then.
fqazi
approved these changes
Jan 10, 2022
Collaborator
fqazi
left a comment
There was a problem hiding this comment.
Reviewed 79 of 79 files at r1, 13 of 74 files at r2.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @fqazi, @postamar, and @samiskin)
Author
|
Thanks for the review! bors r+ |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change contains two refactoring commits:
scpb: move Node to screl, introduce scpb.TargetState. This commit is best reviewed by looking at the changes in scpb first, and then in the protos, and then the rest. The most subsequent complexity is around the event logging and in the stage builder, which benefitted from a deeper rewrite.scplan: make child packages internal, including scgraph and scgraphviz. This just moves stuff around, although there are a few notable changes inplan.go.