Skip to content
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

tidb fatal error: concurrent map read and map write in (*RuntimeStatsColl).ExistsRootStats #39098

Closed
AkiraXie opened this issue Nov 12, 2022 · 2 comments
Labels
affects-6.4 found/automation Found by automation tests severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@AkiraXie
Copy link

AkiraXie commented Nov 12, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. ch workload
  2. cc workload
  3. set global tidb_memory_usage_alarm_ratio = 0.1

2. What did you expect to see? (Required)

no error

3. What did you see instead (Required)

fatal error: concurrent map read and map write goroutine 140623 [running]: github.com/pingcap/tidb/util/execdetails.(*RuntimeStatsColl).ExistsRootStats(0x7f89e449f2c0?, 0x0?) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/execdetails/execdetails.go:766 +0xa6 github.com/pingcap/tidb/planner/core.getRuntimeInfo({0x4eb7f68, 0xc012396500}, {0x4e6f580, 0xc094aff900}, 0x7f8a13c92d28?) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:866 +0x7d github.com/pingcap/tidb/planner/core.getRuntimeInfoStr({0x4eb7f68?, 0xc012396500?}, {0x4e6f580?, 0xc094aff900?}, 0xc094aff900?) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:830 +0xa5 github.com/pingcap/tidb/planner/core.(*Explain).prepareOperatorInfo(0xc093a08f28, {0x4e6f580, 0xc094aff900}, {0xc11196e3e7, 0x9}, {0xc17c099360, 0x1a}) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:895 +0x3c9 github.com/pingcap/tidb/planner/core.(*Explain).explainFlatOpInRowFormat(0xc093a08f28, 0xc095cda6c0) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:815 +0x21d github.com/pingcap/tidb/planner/core.(*Explain).explainFlatPlanInRowFormat(0x4e6efe0?, 0xc095cf85a0) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:796 +0x5f github.com/pingcap/tidb/planner/core.(*Explain).RenderResult(0xc093a08f28) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:763 +0xd4e github.com/pingcap/tidb/planner/core.GetExplainAnalyzeRowsForPlan(0xc093a08f28) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/planner/core/common_plans.go:666 +0x2f github.com/pingcap/tidb/session.(*session).getCurrentAnalyzePlan(0xc012396500, {0x46275e0?, 0xc095889200}, 0xc099563098) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/session/session.go:1647 +0xd7 github.com/pingcap/tidb/util/memoryusagealarm.getCurrentAnalyzePlan(0x5507b?) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:249 +0x53 github.com/pingcap/tidb/util/memoryusagealarm.(*memoryUsageAlarm).getTop10SqlInfo(0xc093a09f20, 0xa80?, {0xc093e77600?, 0x9, 0x36?}) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:291 +0x9e6 github.com/pingcap/tidb/util/memoryusagealarm.(*memoryUsageAlarm).getTop10SqlInfoByCostTime(0x8?, {0xc093e77600?, 0x36?, 0x294?}) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:317 +0x2e github.com/pingcap/tidb/util/memoryusagealarm.(*memoryUsageAlarm).printTop10SqlInfo(0xc1591ad1d0?, {0xc093e77600, 0x9, 0xa4}, 0xc012ad9840?) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:268 +0x50a github.com/pingcap/tidb/util/memoryusagealarm.(*memoryUsageAlarm).recordSQL(0xc14e01d180?, {0x4e700c0?, 0xc0071b1d00?}, {0xc14e01d180, 0x3c}) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:342 +0x43a github.com/pingcap/tidb/util/memoryusagealarm.(*memoryUsageAlarm).doRecord(0xc093a09f20, 0x1f0acf000?, 0xffffffffffffffff?, {0x4e700c0, 0xc0071b1d00}, 0x1) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:228 +0x103e github.com/pingcap/tidb/util/memoryusagealarm.(*memoryUsageAlarm).alarm4ExcessiveMemUsage(0xc093a09f20, {0x4e700c0, 0xc0071b1d00}) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:165 +0x18d github.com/pingcap/tidb/util/memoryusagealarm.(*Handle).Run(0xc0005ab7e8) /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/memoryusagealarm/memoryusagealarm.go:66 +0x113 created by main.createServer /home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:762 +0x4d0
tidb1-1112-err-1.log

4. What is your TiDB version? (Required)

6.4

@AkiraXie AkiraXie added the type/bug The issue is confirmed as a bug. label Nov 12, 2022
@AkiraXie
Copy link
Author

AkiraXie commented Nov 12, 2022

/severity major

@ti-chi-bot ti-chi-bot added severity/major may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 labels Nov 12, 2022
@XuHuaiyu XuHuaiyu added affects-6.4 and removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 labels Nov 13, 2022
@seiya-annie seiya-annie added the sig/execution SIG execution label Nov 14, 2022
@AkiraXie
Copy link
Author

/found automation

@ti-chi-bot ti-chi-bot added the found/automation Found by automation tests label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.4 found/automation Found by automation tests severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants