-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: correctly handle panic for hashjoin build phase #14056
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14056 +/- ##
===========================================
Coverage ? 80.1669%
===========================================
Files ? 483
Lines ? 121126
Branches ? 0
===========================================
Hits ? 97103
Misses ? 16288
Partials ? 7735 |
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 add unit tests.
executor/join.go
Outdated
@@ -16,6 +16,7 @@ package executor | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/pingcap/failpoint" |
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 reorg the import packages.
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
executor/join_test.go
Outdated
@@ -16,6 +16,7 @@ package executor_test | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/pingcap/failpoint" |
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 move it to the 3rd party libs.
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
executor/join.go
Outdated
@@ -244,6 +246,11 @@ func (e *HashJoinExec) fetchBuildSideRows(ctx context.Context, chkCh chan<- *chu | |||
e.buildFinished <- errors.Trace(err) | |||
return | |||
} | |||
failpoint.Inject("errorFetchBuildSideRowsMockOOMPanic", func(val failpoint.Value) { |
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.
failpoint.Inject("errorFetchBuildSideRowsMockOOMPanic", nil)
and c.Assert(failpoint.Enable("github.com/pingcap/tidb/executor/errorFetchBuildSideRowsMockOOMPanic",
panic), IsNil)
executor/join_test.go
Outdated
c.Assert(failpoint.Enable("github.com/pingcap/tidb/executor/errorFetchBuildSideRowsMockOOMPanic", `return(true)`), IsNil) | ||
defer func() { | ||
c.Assert(failpoint.Disable("github.com/pingcap/tidb/executor/errorFetchBuildSideRowsMockOOMPanic"), IsNil) | ||
}() |
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.
Prefer to:
fpName := "github.com/pingcap/tidb/executor/errorFetchBuildSideRowsMockOOMPanic"
c.Assert(failpoint.Enable(fpName, `panic`), IsNil)
defer func() {
c.Assert(failpoint.Disable(fpName), IsNil)
}()
executor/join.go
Outdated
@@ -232,6 +233,7 @@ var buildSideResultLabel fmt.Stringer = stringutil.StringerStr("hashJoin.buildSi | |||
// fetchBuildSideRows fetches all rows from build side executor, and append them | |||
// to e.buildSideResult. | |||
func (e *HashJoinExec) fetchBuildSideRows(ctx context.Context, chkCh chan<- *chunk.Chunk, doneCh <-chan struct{}) { | |||
|
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 remove the empty line.
@fzhedu, please update your pull request. |
1 similar comment
@fzhedu, please update your pull request. |
@fzhedu PR closed due to no update for a long time. Feel free to reopen it anytime. |
e0cd2e8
to
ed1d120
Compare
/run-unit-test |
/rebuild |
1 similar comment
/rebuild |
/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.
LGTM
/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
Your auto merge job has been accepted, waiting for 14637 |
/run-all-tests |
cherry pick to release-3.0 failed |
cherry pick to release-2.1 failed |
What problem does this PR solve?
Fix #14027
What is changed and how it works?
handle the panic when OOM during build a hash table
Check List
Tests
Code changes
Side effects
Related changes
3.0.5
Release note