-
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
MPP: update the state of building a hash table when createOnce throw exceptions #4202
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. |
/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use fmt instead.
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.
Agreed, and you don't have to move the log part out of the try
block.
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
log_msg << " throw exception: unknown error" | ||
<< " In " << watch.elapsedSeconds() << " sec. "; | ||
LOG_ERROR(log, log_msg.rdbuf()); |
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, use LOG_FMT_ERROR instead.
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess now we don't need to catch std::exception
.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when will this branch happen?
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.
just safty check, in case some bugs
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.
deleted
Coverage for changed files
Coverage summary
full 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about calling IProfilingBlockInputStream.cancel
for other subqueries
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 calling
IProfilingBlockInputStream.cancel
for 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 <[email protected]>
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 files
Coverage summary
full coverage report (for internal network access only) |
Signed-off-by: fzhedu [email protected]
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