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

colexec: fix a couple of issues with the new range stats operator #86715

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

yuzefovich
Copy link
Member

This commit fixes a couple of issues with the new range stats operator:

  • it adds the null check for each value before using it as a key
  • it performs a copy of each non-null value before appending it to the
    slice of the roachpb.Keys. This is the limitation of the KV API where
    keys cannot be mutated on the client side once the BatchRequest is
    issued, and we will mutate the incoming Bytes vector since it is reset
    and reused. In theory, this copy should not be necessary, but the race
    gRPC transport complains if the copy is not made.

Fixes: #86545.

Release justification: fixes of new functionality.

Release note: None

This commit fixes a couple of issues with the new range stats operator:
- it adds the null check for each value before using it as a key
- it performs a copy of each non-null value before appending it to the
slice of the `roachpb.Key`s. This is the limitation of the KV API where
keys cannot be mutated on the client side once the BatchRequest is
issued, and we will mutate the incoming `Bytes` vector since it is reset
and reused. In theory, this copy should not be necessary, but the race
gRPC transport complains if the copy is not made.

Release justification: fixes of new functionality.

Release note: None
@yuzefovich yuzefovich requested review from ajwerner and a team August 23, 2022 22:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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:

Thank you!

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 23, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 24, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 24, 2022

Build failed:

@yuzefovich
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Build succeeded:

@craig craig bot merged commit 70e0894 into cockroachdb:master Aug 25, 2022
@yuzefovich yuzefovich deleted the fix-range-stats branch August 25, 2022 14:08
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.

workload/workloadsql: data race in coldata.(*Bytes).Reset()
3 participants