-
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: fix IndexMerge worker panic because of closed channel #29803
Conversation
Signed-off-by: guo-shaoge <shaoge1994@163.com>
[REVIEW NOTIFICATION] This pull request has not been approved. 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. |
Signed-off-by: guo-shaoge <shaoge1994@163.com>
/run-common-test |
/run-check_dev_2 |
/run-mysql-test |
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
…ex_merge_panic Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/1431aeca8ad90d773658ee99ecc2c07eaacdf47c |
/run-integration-common-test tidb-test=pr/1509 |
1 similar comment
/run-integration-common-test tidb-test=pr/1509 |
…to fix_index_merge_panic
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'd better to add more failpoint test cases
resultCh <- &lookupTableTask{ | ||
doneCh: doneCh, | ||
func (w *partialIndexWorker) syncErr(ctx context.Context, fetchCh chan<- *lookupTableTask, err error) { | ||
logutil.Logger(ctx).Error("got error when read index handles", zap.Error(err)) |
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's index handles
?
sql := "select /*+ use_index_merge(t1) */ * from t1 where c1 < 10 or c2 < 10;" | ||
|
||
c.Assert(failpoint.Enable("github.com/pingcap/tidb/executor/partialIndexWorkerError", "return"), IsNil) | ||
err := tk.QueryToErr(sql) |
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.
check the error message here
@@ -684,7 +688,7 @@ func (e *IndexMergeReaderExecutor) handleHandlesFetcherPanic(ctx context.Context | |||
logutil.Logger(ctx).Error(err4Panic.Error()) | |||
doneCh := make(chan error, 1) | |||
doneCh <- err4Panic | |||
resultCh <- &lookupTableTask{ | |||
ch <- &lookupTableTask{ |
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.
Add a failpoint test for this panic
@guo-shaoge: PR needs rebase. 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 kubernetes/test-infra repository. |
Signed-off-by: guo-shaoge shaoge1994@163.com
What problem does this PR solve?
Issue Number: close #29610
Problem Summary:
When
partial index worker
got error, it will write give err tomain worker
usingresultCh
. ButresultCh
may already be closed(Maybe becauseprocess worker
finished and close it).What is changed and how it works?
partial index worker
wirte its err msg usingfetchCh
instead of usingresultCh
directly.Check List
Tests
Side effects
Documentation
Release note