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
opt: fix data race when building filters item props #37972
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit fixes a race condition where two threads could be simultaneously trying to build the logical properties of a filters item and stepping on each others toes. In particular, one thread could set scalar.Constraints to nil, causing a panic when another thread tries to check whether scalar.Constraints.IsUnconstrained(). This commit fixes the issue by using a local variable to check whether the constraint set is unconstrained. Fixes cockroachdb#37951 Informs cockroachdb#37073 Informs cockroachdb#36148 Release note (bug fix): Fixed a race condition that could cause a panic during query planning.
RaduBerinde
approved these changes
Jun 3, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
rytaft
commented
Jun 3, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball and @justinj)
craig bot
pushed a commit
that referenced
this pull request
Jun 3, 2019
37972: opt: fix data race when building filters item props r=rytaft a=rytaft This commit fixes a race condition where two threads could be simultaneously trying to build the logical properties of a filters item and stepping on each others toes. In particular, one thread could set `scalar.Constraints` to nil, causing a panic when another thread tries to check whether `scalar.Constraints.IsUnconstrained()`. This commit fixes the issue by using a local variable to check whether the constraint set is unconstrained. Fixes #37951 Informs #37073 Informs #36148 Release note (bug fix): Fixed a race condition that could cause a panic during query planning. Co-authored-by: Rebecca Taft <becca@cockroachlabs.com>
Build succeeded |
mgartner
added a commit
to mgartner/cockroach
that referenced
this pull request
Jul 29, 2022
This commit reverts cockroachdb#37972. We no longer lazily build filter props and share them across multiple threads. Release note: None
mgartner
added a commit
to mgartner/cockroach
that referenced
this pull request
Aug 1, 2022
This commit reverts cockroachdb#37972. We no longer lazily build filter props and share them across multiple threads. Release note: None
craig bot
pushed a commit
that referenced
this pull request
Aug 1, 2022
84420: sql/logictests: don't fail parent test when using retry r=knz a=stevendanna testutils.SucceedsSoon calls Fatal() on the passed testing.T. Here, we were calling SucceedsSoon with the root T, which in the case of a subtest resulted in this error showing up in our logs testing.go:1169: test executed panic(nil) or runtime.Goexit: subtest may have called FailNow on a parent test This moves to using SucceedsSoonError so that we can process errors using the same formatting that we use elsewhere. Release note: None 85120: roachpb: make range/replica descriptor fields non-nullable r=pavelkalinnikov a=erikgrinaker This patch makes all fields in range/replica descriptors non-nullable, fixing a long-standing TODO. Additionally, this fixes a set of bugs where code would use regular comparison operators (e.g. `==`) to compare replica descriptors, which with nullable pointer fields would compare the memory locations rather than the values. One practical consequence of this was that the DistSender would fail to use a new leaseholder with a non-`VOTER` type (e.g. `VOTER_INCOMING`), instead continuing to try other replicas before backing off. However, there are further issues surrounding this bug and it will be addressed separately in a way that is more amenable to backporting. The preparatory work for this was done in ea720e3. Touches #85060. Touches #38308. Touches #38465. Release note: None 85352: opt: revert data race fix r=mgartner a=mgartner This commit reverts #37972. We no longer lazily build filter props and share them across multiple threads. Release note: None Co-authored-by: Steven Danna <danna@cockroachlabs.com> Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com> Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit fixes a race condition where two threads could be
simultaneously trying to build the logical properties of a filters
item and stepping on each others toes. In particular, one thread
could set
scalar.Constraints
to nil, causing a panic when anotherthread tries to check whether
scalar.Constraints.IsUnconstrained()
.This commit fixes the issue by using a local variable to check whether
the constraint set is unconstrained.
Fixes #37951
Informs #37073
Informs #36148
Release note (bug fix): Fixed a race condition that could cause a
panic during query planning.