Skip to content

scpb and scplan refactor#74598

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
postamar:scpb-refactor-squashed
Jan 10, 2022
Merged

scpb and scplan refactor#74598
craig[bot] merged 2 commits intocockroachdb:masterfrom
postamar:scpb-refactor-squashed

Conversation

@postamar
Copy link
Copy Markdown

@postamar postamar commented Jan 8, 2022

This change contains two refactoring commits:

  1. 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.
  2. scplan: make child packages internal, including scgraph and scgraphviz. This just moves stuff around, although there are a few notable changes in plan.go.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@postamar postamar force-pushed the scpb-refactor-squashed branch from 811bb70 to ec66c57 Compare January 9, 2022 18:06
Marius Posta 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
@postamar postamar force-pushed the scpb-refactor-squashed branch from ec66c57 to ed182ed Compare January 10, 2022 14:11
@postamar postamar marked this pull request as ready for review January 10, 2022 15:54
@postamar postamar requested review from a team as code owners January 10, 2022 15:54
@postamar postamar requested review from a team and samiskin and removed request for a team January 10, 2022 15:54
message NewSchemaChangeDetails {
repeated cockroach.sql.schemachanger.scpb.Target targets = 1;

cockroach.sql.schemachanger.scpb.TargetState target_state = 5 [(gogoproto.nullable) = false];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need to reserve 1,2,3?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
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.

Reviewed 79 of 79 files at r1, 13 of 74 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @fqazi, @postamar, and @samiskin)

@postamar
Copy link
Copy Markdown
Author

Thanks for the review!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 10, 2022

Build succeeded:

@craig craig bot merged commit e1d95fe into cockroachdb:master Jan 10, 2022
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