-
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
analyze worker didn't exit successfully when panic during analyze table #51993
Labels
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
severity/major
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Comments
analyze statement failed to exit normally after encountering memory control and has been stuck for more than 10 hours. After analyzing the reason, I feel that it is caused by improper use of chan. The phenomenon of being stuck is:
func (e *AnalyzeExec) analyzeWorker(taskCh <-chan *analyzeTask, resultsCh chan<- *statistics.AnalyzeResults) {
var task *analyzeTask
defer func() {
if r := recover(); r != nil {
logutil.BgLogger().Error("analyze worker panicked", zap.Any("recover", r), zap.Stack("stack"))
metrics.PanicCounter.WithLabelValues(metrics.LabelAnalyze).Inc()
resultsCh <- &statistics.AnalyzeResults{
Err: getAnalyzePanicErr(r),
Job: task.job,
}
}
}()
var err error
for panicCnt < statsConcurrency {
if err := e.Ctx().GetSessionVars().SQLKiller.HandleSignal(); err != nil {
close(saveResultsCh)
return err
}
results, ok := <-resultsCh
if !ok {
break
}
|
I encounter another panic error |
13 tasks
13 tasks
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
severity/major
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
import a table with 500+ partition
execute "analyze table xxx"
2. What did you expect to see? (Required)
analyze table can be executed successfully
3. What did you see instead (Required)
the jobs are stuck
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: