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

*: audit operation names in new schema changer #88082

Merged

Conversation

Xiang-Gu
Copy link
Contributor

@Xiang-Gu Xiang-Gu commented Sep 17, 2022

This PR made non-functional changes related to new schema changer ops:

  1. Rename all status changing operation on Index and Column to comform
    to the pattern: Make[StatusA][Index/Column][StatusB]

  2. Rename a few constant/field/function names to be consistent with the
    principle of "being explicit":
    2.1. Rename operation name XxxGcXxx to XxxGCXxx;
    2.2. Rename field name in operations DescID to DescriptorID;
    2.3. Rename descpb.DELETE_AND_WRITE_ONLY to descpb.WRITE_ONLY;
    2.4. Rename sql.RunningStatusDeleteAndWriteOnly to sql.RunningStatusWriteOnly

  3. Seveal comments enhencement

  4. Rename DELETE_AND_WRITE_ONLY to WRITE_ONLY in some files under
    docs/.

Fixes #84583

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@Xiang-Gu Xiang-Gu force-pushed the audit_operation_names_in_new_schema_changer branch from 9c98469 to ada4662 Compare September 19, 2022 13:59
@postamar
Copy link
Contributor

postamar commented Sep 19, 2022

I like all of this, except 2.3. The choice of WRITE_ONLY was deliberate and ideally we'd be renaming descpb.DELETE_AND_WRITE_ONLY instead. There's no way you could have known this so don't feel bad.

@Xiang-Gu Xiang-Gu force-pushed the audit_operation_names_in_new_schema_changer branch 2 times, most recently from 2a47c27 to e6de1e4 Compare September 21, 2022 16:58
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, thanks for doing this, assuming that changing the running status text is OK.

// DELETE_AND_WRITE_ONLY state.
RunningStatusDeleteAndWriteOnly jobs.RunningStatus = "waiting in DELETE-AND-WRITE_ONLY"
// WRITE_ONLY state.
RunningStatusWriteOnly jobs.RunningStatus = "waiting in WRITE_ONLY"
Copy link
Contributor

Choose a reason for hiding this comment

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

@ajwerner is it OK to change these running status messages? I think so but I ask just to be sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

andrew said to me offline that this is fine.

@@ -2760,7 +2760,7 @@ func (r schemaChangeResumer) OnFailOrCancel(
}
}

// If this is a schema change to drop a database or schema, DescID will be
// If this is a schema change to drop a database or schema, DescriptorID will be
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this change should not be made

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@Xiang-Gu Xiang-Gu force-pushed the audit_operation_names_in_new_schema_changer branch from e6de1e4 to 2740201 Compare September 22, 2022 18:19
This PR made non-functional changes related to new schema changer ops:
1. Rename all status changing operation on Index and Column to comform
to the pattern: `Make[StatusA][Index/Column][StatusB]`

2. Rename a few constant/field/function names to be consistent with the
principle of "being explicit":
  2.1. Rename operation name `XxxGcXxx` to `XxxGCXxx`;
  2.2. Rename field name in operations `DescID` to `DescriptorID`;
  2.3. Rename descpb.DELETE_AND_WRITE_ONLY to descpb.WRITE_ONLY;
  2.4. Rename sql.RunningStatusDeleteAndWriteOnly to sql.RunningStatusWriteOnly

3. Seveal comments enhencement

4. Rename `DELETE_AND_WRITE_ONLY` to `WRITE_ONLY` in some files under
docs/.

Release note: None
@Xiang-Gu Xiang-Gu force-pushed the audit_operation_names_in_new_schema_changer branch from 2740201 to b31d532 Compare September 22, 2022 18:20
@Xiang-Gu Xiang-Gu marked this pull request as ready for review September 22, 2022 18:20
@Xiang-Gu Xiang-Gu requested review from a team as code owners September 22, 2022 18:20
@Xiang-Gu Xiang-Gu requested a review from a team September 22, 2022 18:20
@Xiang-Gu Xiang-Gu requested a review from a team as a code owner September 22, 2022 18:20
@Xiang-Gu Xiang-Gu requested review from benbardin and shermanCRL and removed request for a team September 22, 2022 18:20
@Xiang-Gu
Copy link
Contributor Author

TFTR!

bors r+

@craig craig bot merged commit d390148 into cockroachdb:master Sep 22, 2022
@craig
Copy link
Contributor

craig bot commented Sep 22, 2022

Build succeeded:

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.

scop: audit operation names
3 participants