-
Notifications
You must be signed in to change notification settings - Fork 410
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 mpp hang error if some error happens during compile of mpp plan in TiFlash #1533
Fix mpp hang error if some error happens during compile of mpp plan in TiFlash #1533
Conversation
/run-all-tests |
1 similar comment
/run-all-tests |
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.
Leave inline comments. Generally a good exception handling.
dbms/src/Flash/Mpp/MPPHandler.h
Outdated
} | ||
catch (...) | ||
{ | ||
LOG_WARNING(log, "Failed to finish all tunnels"); |
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.
We could leverage the follow method for logging the exception either. Otherwise we know only it failed but lost the reason.
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.
Good idea!
dbms/src/Flash/Mpp/MPPHandler.cpp
Outdated
} | ||
catch (...) | ||
{ | ||
LOG_ERROR(log, "Fail to handle error in while trying to handle error and clean task"); |
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.
ditto
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.
Rest LGTM
dbms/src/Flash/Mpp/MPPHandler.h
Outdated
/// root task. Because for root task, if DispatchMPPTask fails, TiDB does | ||
/// not sending establish MPP connection request at all, it is meaningless | ||
/// to check the connect status in this case, just finish the tunnel. | ||
void finish() |
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.
What about use a more critical word like destroy
?
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.
OK, I will use close
dbms/src/Flash/Mpp/MPPHandler.h
Outdated
@@ -279,6 +291,20 @@ struct MPPTask : std::enable_shared_from_this<MPPTask>, private boost::noncopyab | |||
|
|||
void cancel(); | |||
|
|||
void finishAllTunnel() |
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.
ditto.
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
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
/run-all-tests |
What problem does this PR solve?
Issue Number: close #1529
Problem Summary:
As the issue described.
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
The root cause is if a mpp task failed in
DispatchMPPTask
stage, TiFlash does not handle the error properly, which makes the query hangs. In this pr, error handle logical is added.Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note