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
*: fix index join on partition table data race #33979
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/90b149394003037986cdd52dca31ede68a5fea5e |
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 and thanks for the "to the point" description of the change!
I only have one small question/suggestion.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 0f39f6d
|
/merge |
/run-check_dev |
1 similar comment
/run-check_dev |
/merge |
TiDB MergeCI notify
|
What problem does this PR solve?
Issue Number: close #33751 #33762 #32846
Problem Summary:
What is changed and how it works?
IndexJoin executor builds the inner executor in different goroutine, and
PartitionPruning
is called during the executor building.PartitionPruning
is not thread-safe, so the code get DATA RACE.I use
sync.Once
to doPartitionPruning
only once and it also avoid the DATA RACE.pushDownNot
is not thread safe, it modifies theconds
slice.I move this part to from executor building phase to physical plan phase to avoid concurrent.
And
session.ParseSQL
is not thread-safe, in index join, hash partition pruning, several inner executor will be built at the same time. They would callsession.ParseSQL
in several different goroutines.I revert a small optimization to make
session.ParseSQL
thread-safe.Check List
Tests
Check no data race after this fix:
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.