MPP: update the state of building a hash table when createOnce throw exceptions#4202
MPP: update the state of building a hash table when createOnce throw exceptions#4202ti-chi-bot merged 15 commits intopingcap:masterfrom
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. DetailsReviewer can indicate their review by submitting an approval review. |
|
/run-all-tests |
| std::stringstream log_msg; | ||
| log_msg << std::fixed << std::setprecision(3); | ||
| log_msg << (subquery.set ? "Creating set. " : "") | ||
| << (subquery.join ? "Creating join. " : "") << (subquery.table ? "Filling temporary table. " : "") << " for task " | ||
| << mpp_task_id.toString(); | ||
|
|
||
| LOG_DEBUG(log, log_msg.rdbuf()); |
There was a problem hiding this comment.
Agreed, and you don't have to move the log part out of the try block.
| log_msg << " throw exception: unknown error" | ||
| << " In " << watch.elapsedSeconds() << " sec. "; | ||
| LOG_ERROR(log, log_msg.rdbuf()); |
There was a problem hiding this comment.
ditto, use LOG_FMT_ERROR instead.
| catch (std::exception & e) | ||
| { | ||
| std::unique_lock<std::mutex> lock(exception_mutex); | ||
| log_msg << " throw exception: " << e.what() << " In " << watch.elapsedSeconds() << " sec. "; | ||
| LOG_ERROR(log, log_msg.rdbuf()); | ||
| exception_from_workers.push_back(std::current_exception()); | ||
| if (subquery.join) | ||
| subquery.join->setFinishBuildTable(true); | ||
| } |
There was a problem hiding this comment.
guess now we don't need to catch std::exception.
There was a problem hiding this comment.
why not?
we should push the exception and set finish flag here.
| LOG_DEBUG(log, "Creat all tasks of " << mpp_task_id.toString() << " take " << watch.elapsedSeconds() << " sec with exception and rethrow the first, left " << exception_from_workers.size()); | ||
| std::rethrow_exception(exception_from_workers.front()); | ||
| } | ||
| else |
There was a problem hiding this comment.
when will this branch happen?
There was a problem hiding this comment.
just safty check, in case some bugs
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
| std::stringstream log_msg; | ||
| log_msg << std::fixed << std::setprecision(3); | ||
| log_msg << (subquery.set ? "Creating set. " : "") | ||
| << (subquery.join ? "Creating join. " : "") << (subquery.table ? "Filling temporary table. " : "") << " for task " | ||
| << mpp_task_id.toString(); | ||
|
|
||
| LOG_DEBUG(log, log_msg.rdbuf()); |
There was a problem hiding this comment.
Agreed, and you don't have to move the log part out of the try block.
| LOG_ERROR(log, log_msg.rdbuf()); | ||
| exception_from_workers.push_back(std::current_exception()); | ||
| if (subquery.join) | ||
| subquery.join->setFinishBuildTable(true); |
There was a problem hiding this comment.
Why not add a flag indicating whether the build success or not in Join, so in probe stage, we don't have to do the actual probe if the build failed.
There was a problem hiding this comment.
How about calling IProfilingBlockInputStream.cancel for other subqueries
There was a problem hiding this comment.
How about calling
IProfilingBlockInputStream.cancelfor other subqueries
that will break the current cancel process. now, first tiflash report errors to tidb, then tidb sends kill command, last, the tiflash conduct the cancel command.
|
Please add a test for this. |
|
In response to a cherrypick label: new pull request created: #4268. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created: #4269. |
|
In response to a cherrypick label: new pull request created: #4270. |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
Signed-off-by: fzhedu fzhedu@gmail.com
What problem does this PR solve?
Issue Number: close #4195
Problem Summary:
set FinishBuild be true when createOnce throw exceptions
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note