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

release-21.1: sql: add tabledesc.NewUnsafeImmutable constructor #62616

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

postamar
Copy link

Backport 1/1 commits from #62388.

/cc @cockroachdb/release


sql: add tabledesc.NewUnsafeImmutable constructor

Recent benchmark results revealed a performance regression in
TableReader caused by the recent introduction of the descriptor builder
pattern which deep-copies descpb messages using protoutil.Clone.
See issue #62212 and commit 15ee387.

This commit adds an unsafe table descriptor constructor which is used
with table descriptors in execinfrapb messages. This unsafe constructor
does not perform a deep copy. In this particular context this isn't a
problem, because the table descriptor proto only exists as a means to
serialize table descriptors across nodes in a read-only fashion and is
known to not be used in any other capacity.

Release note: None

Recent benchmark results revealed a performance regression in
TableReader caused by the recent introduction of the descriptor builder
pattern which deep-copies descpb messages using protoutil.Clone.
See issue cockroachdb#62212 and commit 15ee387.

This commit adds an unsafe table descriptor constructor which is used
with table descriptors in execinfrapb messages. This unsafe constructor
does not perform a deep copy. In this particular context this isn't a
problem, because the table descriptor proto only exists as a means to
serialize table descriptors across nodes in a read-only fashion and is
known to not be used in any other capacity.

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@postamar postamar requested a review from ajwerner March 25, 2021 18:46
@postamar
Copy link
Author

Reverting adb8345 at the head of this branch should trigger the bugs discussed in #62557

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

Reviewed 12 of 13 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @postamar)

Copy link
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:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @postamar)

@ajwerner ajwerner merged commit e118318 into cockroachdb:release-21.1 Mar 25, 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.

3 participants