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

DATA RACE: using SessionVars.PlannerSelectBlockAsName in planbuilder.go when doing "CheckTableExec" #42342

Closed
Tracked by #41316
zimulala opened this issue Mar 17, 2023 · 0 comments · Fixed by #42344
Closed
Tracked by #41316
Labels
component/test severity/moderate type/bug The issue is confirmed as a bug.

Comments

@zimulala
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fghpr_mysql_test/detail/ghpr_mysql_test/17635/pipeline

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

No data race

3. What did you see instead (Required)

==================

WARNING: DATA RACE

Read at 0x00c012696580 by goroutine 1071685:

  github.com/pingcap/tidb/planner/core.(*PlanBuilder).Init()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/planner/core/planbuilder.go:731 +0x88

  github.com/pingcap/tidb/planner/core.rewriteAstExpr()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/planner/core/expression_rewriter.go:72 +0x193

  github.com/pingcap/tidb/expression.ColumnInfos2ColumnsAndNames()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/expression/expression.go:1001 +0xd7a

  github.com/pingcap/tidb/util/admin.makeRowDecoder()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/admin/admin.go:196 +0x3b6

  github.com/pingcap/tidb/util/admin.iterRecords()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/admin/admin.go:224 +0x6b5

  github.com/pingcap/tidb/util/admin.CheckRecordAndIndex()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/admin/admin.go:186 +0x4fd

  github.com/pingcap/tidb/executor.(*CheckTableExec).checkTableRecord()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/executor/executor.go:1089 +0x413

  github.com/pingcap/tidb/executor.(*CheckTableExec).Next.func2.1()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/executor/executor.go:1053 +0x24d

  github.com/pingcap/tidb/util.WithRecovery()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/misc.go:96 +0x6d

  github.com/pingcap/tidb/executor.(*CheckTableExec).Next.func2()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/executor/executor.go:1042 +0xc7

  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/wait_group_wrapper.go:154 +0x73



Previous write at 0x00c012696580 by goroutine 1071684:

  github.com/pingcap/tidb/planner/core.(*PlanBuilder).Init()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/planner/core/planbuilder.go:735 +0x13d

  github.com/pingcap/tidb/planner/core.rewriteAstExpr()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/planner/core/expression_rewriter.go:72 +0x193

  github.com/pingcap/tidb/expression.ColumnInfos2ColumnsAndNames()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/expression/expression.go:1001 +0xd7a

  github.com/pingcap/tidb/util/admin.makeRowDecoder()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/admin/admin.go:196 +0x3b6

  github.com/pingcap/tidb/util/admin.iterRecords()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/admin/admin.go:224 +0x6b5

  github.com/pingcap/tidb/util/admin.CheckRecordAndIndex()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/admin/admin.go:186 +0x4fd

  github.com/pingcap/tidb/executor.(*CheckTableExec).checkTableRecord()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/executor/executor.go:1089 +0x413

  github.com/pingcap/tidb/executor.(*CheckTableExec).Next.func2.1()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/executor/executor.go:1053 +0x24d

  github.com/pingcap/tidb/util.WithRecovery()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/misc.go:96 +0x6d

  github.com/pingcap/tidb/executor.(*CheckTableExec).Next.func2()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/executor/executor.go:1042 +0xc7

  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

      /home/jenkins/agent/workspace/pingcap/tidb/ghpr_mysql_test/tidb/util/wait_group_wrapper.go:154 +0x73

4. What is your TiDB version? (Required)

master
reproduce pr: #42264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants