-
Notifications
You must be signed in to change notification settings - Fork 409
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 potential hang in right join #6690
Fix potential hang in right join #6690
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. |
@@ -120,7 +120,7 @@ void CreatingSetsBlockInputStream::createAll() | |||
for (auto & elem : subqueries_for_sets) | |||
{ | |||
if (elem.second.join) | |||
elem.second.join->setBuildTableState(Join::BuildTableState::WAITING); | |||
elem.second.join->setInitActiveBuildConcurrency(); |
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.
how about moving to PhysicalJoin
?
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.
Currently, it must be set after compile, see the comments in https://github.com/pingcap/tiflash/pull/6690/files#diff-e6f85ec76cd474ca862de277609c1dfbc11aa70692a3acf3f4e85fefb649cb65R473-R474
b8cd858
to
f22eceb
Compare
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
dbms/src/Interpreters/Join.cpp
Outdated
void Join::waitUntilAllProbeFinished() const | ||
{ | ||
std::unique_lock lock(build_probe_mutex); | ||
probe_cv.wait(lock, [&]() { | ||
return meet_error || active_probe_concurrency == 0; | ||
}); | ||
if (meet_error) | ||
throw Exception("Join meet error before all probe finished!"); | ||
} | ||
|
||
void Join::waitUntilAllBuildFinished() const | ||
{ | ||
std::unique_lock lk(build_probe_mutex); | ||
|
||
build_cv.wait(lk, [&]() { return meet_error || active_build_concurrency == 0; }); | ||
if (meet_error) /// throw this exception once failed to build the hash table | ||
throw Exception("Build failed before join probe!"); | ||
} |
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.
These two similar functions have different code styles. (e.g. indentation and blank lines)
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.
Done
|
||
if (subquery.join) | ||
{ | ||
FAIL_POINT_TRIGGER_EXCEPTION(FailPoints::exception_mpp_hash_build); |
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.
extern const char exception_mpp_hash_build[];
in this file can also be deleted.
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.
Done.
32b5c92
to
15e0ef9
Compare
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
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
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
15e0ef9
to
4f1218c
Compare
/merge |
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 4f1218c
|
/run-unit-test |
/run-integration-test |
@windtalker: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-integration-test |
3 similar comments
/run-integration-test |
/run-integration-test |
/run-integration-test |
ref pingcap#6528, ref pingcap#6692 Signed-off-by: ywqzzy <592838129@qq.com>
What problem does this PR solve?
Issue Number: ref #6528 #6692
Problem Summary:
#6576 introduce a potential bug that for a right join, if probe thread meet error, some probe thread maybe hang forever.
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note