Skip to content

sql: deprecate TableDescriptor.GCMutations#75280

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
stevendanna:ssd/deprecate-gc-mutations
Jan 25, 2022
Merged

sql: deprecate TableDescriptor.GCMutations#75280
craig[bot] merged 1 commit intocockroachdb:masterfrom
stevendanna:ssd/deprecate-gc-mutations

Conversation

@stevendanna
Copy link
Copy Markdown
Collaborator

This appears unused. While the schema changer adds entries that the gc
job subsequently removes, the only other code that made use of this
field (outside of tests) was FindIndexByID. FindIndexByID appears to
use it to return a special error that no one looks for.

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown

@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.

Let's see what CI finds to complain about but this looks OK to me so far. I can already tell you that you'll have to remove the "GCMutations" entry from the validationMap in validate_test.go in the tabledesc package.

repeated GCDescriptorMutation gc_mutations = 33 [(gogoproto.nullable) = false,
(gogoproto.customname) = "GCMutations"];
(gogoproto.customname) = "GCMutations",
deprecated = true];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe you could get away with outright removing this field (well, replacing it with a reserved 33 to prevent reuse of this tag number in this proto) and then remove updateDescriptorGCMutations outright. Sure, any descriptors might still have a populated GCMutations around, but:

  • it's a handful of bytes at worst,
  • if it's never read, it doesn't matter what's in it,
  • plus it will disappear the next time that the table descriptor is updated.

This shouldn't cause any problems in a mixed-version cluster either. Worst case the GC job gets picked up by a node with the old version, which then edits this slice when it's done. It kind of expects the GC'd index to be in the slice, but doesn't complain if it's not.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Happy to go either way here. What would SQL prefer?

@postamar postamar requested a review from ajwerner January 21, 2022 17:46
@postamar
Copy link
Copy Markdown

There are CI failures but they should be trivial to fix. Nice! I look forward to approving this.

Copy link
Copy Markdown
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm: mod CI too

Reviewed 9 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner, @postamar, and @stevendanna)


pkg/sql/gcjob/descriptor_utils.go, line 26 at r1 (raw file):

)

// updateDescriptorGCMutations removes the GCMutation for tie given

s/tie/the/

@stevendanna stevendanna force-pushed the ssd/deprecate-gc-mutations branch from e3d31ce to f80672c Compare January 24, 2022 09:16
This appears unused. While the schema changer adds entries that the gc
job subsequently removes, the only other code that made use of this
field (outside of tests) was FindIndexByID. FindIndexByID appears to
use it to return a special error that no one looks for.

Release note: None
@stevendanna stevendanna force-pushed the ssd/deprecate-gc-mutations branch from f80672c to c08ae50 Compare January 24, 2022 10:13
@stevendanna stevendanna marked this pull request as ready for review January 24, 2022 11:52
@stevendanna stevendanna requested a review from a team as a code owner January 24, 2022 11:52
@stevendanna stevendanna requested a review from a team January 24, 2022 11:52
@stevendanna stevendanna requested a review from a team as a code owner January 24, 2022 11:52
Copy link
Copy Markdown

@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.

Reviewed 10 of 10 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @stevendanna)


pkg/sql/catalog/descpb/structured.proto, line 1124 at r1 (raw file):

Previously, stevendanna (Steven Danna) wrote…

Happy to go either way here. What would SQL prefer?

The best PR is the PR that gets merged quickly, so please just go ahead and merge this one and we'll create ourselves a followup issue to track the removal in the next release.

@stevendanna
Copy link
Copy Markdown
Collaborator Author

bors r=postamar,ajwerner

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 24, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 24, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 25, 2022

Build succeeded:

@craig craig bot merged commit c956f4c into cockroachdb:master Jan 25, 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