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 at the PointGetPlan #43339

Closed
Tracked by #41316
hawkingrei opened this issue Apr 24, 2023 · 0 comments · Fixed by #53676
Closed
Tracked by #41316

DATA RACE at the PointGetPlan #43339

hawkingrei opened this issue Apr 24, 2023 · 0 comments · Fixed by #53676
Assignees
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/test severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

3. What did you see instead (Required)

==================
WARNING: DATA RACE
Write at 0x00c00f4ad180 by goroutine 58307:
  github.com/pingcap/tidb/planner/core.(*PointGetPlan).statsInfo()
      planner/core/point_get_plan.go:223 +0xfd
  github.com/pingcap/tidb/planner/core.(*PointGetPlan).getEstRowCountForDisplay()
      planner/core/point_get_plan.go:105 +0x119
  github.com/pingcap/tidb/planner/core.encodeFlatPlanTree()
      planner/core/encode.go:105 +0x241
  github.com/pingcap/tidb/planner/core.EncodeFlatPlan()
      planner/core/encode.go:62 +0x529
  github.com/pingcap/tidb/executor.getEncodedPlan()
      executor/adapter.go:1696 +0x164
  github.com/pingcap/tidb/executor.(*ExecStmt).SummaryStmt.func1()
      executor/adapter.go:1757 +0x64
  github.com/pingcap/tidb/util/stmtsummary.newStmtSummaryByDigestElement()
      util/stmtsummary/statement_summary.go:635 +0x78
  github.com/pingcap/tidb/util/stmtsummary.(*stmtSummaryByDigest).add.func1()
      util/stmtsummary/statement_summary.go:590 +0x26d
  github.com/pingcap/tidb/util/stmtsummary.(*stmtSummaryByDigest).add()
      util/stmtsummary/statement_summary.go:601 +0x54
  github.com/pingcap/tidb/util/stmtsummary.(*stmtSummaryByDigestMap).AddStatement()
      util/stmtsummary/statement_summary.go:344 +0x4f1
  github.com/pingcap/tidb/util/stmtsummary/v2.Add()
      util/stmtsummary/v2/stmtsummary.go:537 +0x9e
  github.com/pingcap/tidb/executor.(*ExecStmt).SummaryStmt()
      executor/adapter.go:1855 +0x1a14
  github.com/pingcap/tidb/executor.(*ExecStmt).FinishExecuteStmt()
      executor/adapter.go:1342 +0x604
  github.com/pingcap/tidb/executor.(*ExecStmt).CloseRecordSet()
      executor/adapter.go:1415 +0x50
  github.com/pingcap/tidb/executor.(*recordSet).Close()
      executor/adapter.go:180 +0xbd
  github.com/pingcap/tidb/session.(*execStmtResult).Close()
      session/session.go:2403 +0x6f
  github.com/pingcap/tidb/server.(*tidbResultSet).Close()
      server/driver_tidb.go:446 +0x64
  github.com/pingcap/tidb/server.ResultSet.Close-fm()
      <autogenerated>:1 +0x48
  github.com/pingcap/tidb/parser/terror.Call()
      parser/terror/terror.go:315 +0x4a
  github.com/pingcap/tidb/server.(*clientConn).handleStmt.func1()
      server/conn.go:2068 +0x39
  runtime.deferreturn()
      GOROOT/src/runtime/panic.go:476 +0x32
  github.com/pingcap/tidb/server.(*clientConn).handleQuery()
      server/conn.go:1852 +0xce4
  github.com/pingcap/tidb/server.(*clientConn).dispatch()
      server/conn.go:1339 +0x1537
  github.com/pingcap/tidb/server.(*clientConn).Run()
      server/conn.go:1120 +0x3db
  github.com/pingcap/tidb/server.(*Server).onConn()
      server/server.go:677 +0x249c
  github.com/pingcap/tidb/server.(*Server).startNetworkListener.func1()
      server/server.go:491 +0x47
Previous write at 0x00c00f4ad180 by goroutine 59382:
  github.com/pingcap/tidb/planner/core.(*PointGetPlan).statsInfo()
      planner/core/point_get_plan.go:223 +0xfd
  github.com/pingcap/tidb/planner/core.(*PointGetPlan).getEstRowCountForDisplay()
      planner/core/point_get_plan.go:105 +0x119
  github.com/pingcap/tidb/planner/core.binaryOpFromFlatOp()
      planner/core/common_plans.go:1230 +0x633
  github.com/pingcap/tidb/planner/core.binaryOpTreeFromFlatOps()
      planner/core/common_plans.go:1186 +0xf8
  github.com/pingcap/tidb/planner/core.binaryDataFromFlatPlan()
      planner/core/common_plans.go:1176 +0x206
  github.com/pingcap/tidb/planner/core.BinaryPlanStrFromFlatPlan()
      planner/core/common_plans.go:1146 +0x44
  github.com/pingcap/tidb/executor.getBinaryPlan()
      executor/adapter.go:1651 +0xaf
  github.com/pingcap/tidb/executor.(*ExecStmt).SummaryStmt.func2()
      executor/adapter.go:1762 +0x4b
  github.com/pingcap/tidb/util/stmtsummary.newStmtSummaryByDigestElement()
      util/stmtsummary/statement_summary.go:641 +0x12e
  github.com/pingcap/tidb/util/stmtsummary.(*stmtSummaryByDigest).add.func1()
      util/stmtsummary/statement_summary.go:590 +0x26d
  github.com/pingcap/tidb/util/stmtsummary.(*stmtSummaryByDigest).add()
      util/stmtsummary/statement_summary.go:601 +0x54
  github.com/pingcap/tidb/util/stmtsummary.(*stmtSummaryByDigestMap).AddStatement()
      util/stmtsummary/statement_summary.go:344 +0x4f1
  github.com/pingcap/tidb/util/stmtsummary/v2.Add()
      util/stmtsummary/v2/stmtsummary.go:537 +0x9e
  github.com/pingcap/tidb/executor.(*ExecStmt).SummaryStmt()
      executor/adapter.go:1855 +0x1a14
  github.com/pingcap/tidb/executor.(*ExecStmt).FinishExecuteStmt()
      executor/adapter.go:1342 +0x604
  github.com/pingcap/tidb/executor.(*ExecStmt).CloseRecordSet()
      executor/adapter.go:1415 +0x50
  github.com/pingcap/tidb/executor.(*recordSet).Close()
      executor/adapter.go:180 +0xbd
  github.com/pingcap/tidb/session.(*execStmtResult).Close()
      session/session.go:2403 +0x6f
  github.com/pingcap/tidb/server.(*tidbResultSet).Close()
      server/driver_tidb.go:446 +0x64
  github.com/pingcap/tidb/server.ResultSet.Close-fm()
      <autogenerated>:1 +0x48
  github.com/pingcap/tidb/parser/terror.Call()
      parser/terror/terror.go:315 +0x4a
  github.com/pingcap/tidb/server.(*clientConn).handleStmt.func1()
      server/conn.go:2068 +0x39
  runtime.deferreturn()
      GOROOT/src/runtime/panic.go:476 +0x32
  github.com/pingcap/tidb/server.(*clientConn).handleQuery()
      server/conn.go:1852 +0xce4
  github.com/pingcap/tidb/server.(*clientConn).dispatch()
      server/conn.go:1339 +0x1537
  github.com/pingcap/tidb/server.(*clientConn).Run()
      server/conn.go:1120 +0x3db
  github.com/pingcap/tidb/server.(*Server).onConn()
      server/server.go:677 +0x249c
  github.com/pingcap/tidb/server.(*Server).startNetworkListener.func1()
      server/server.go:491 +0x47
Goroutine 58307 (running) created at:
  github.com/pingcap/tidb/server.(*Server).startNetworkListener()
      server/server.go:491 +0x9bb
  github.com/pingcap/tidb/server.(*Server).Run.func1()
      server/server.go:406 +0x65
Goroutine 59382 (running) created at:
  github.com/pingcap/tidb/server.(*Server).startNetworkListener()
      server/server.go:491 +0x9bb
  github.com/pingcap/tidb/server.(*Server).Run.func1()
      server/server.go:406 +0x65 

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Apr 24, 2023
@ti-chi-bot ti-chi-bot bot added 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.1 may-affects-6.5 may-affects-7.1 labels May 4, 2023
@aytrack aytrack removed 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.1 may-affects-6.5 may-affects-7.1 labels May 4, 2023
@ti-chi-bot ti-chi-bot added the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Oct 23, 2023
@ti-chi-bot ti-chi-bot added the affects-8.1 This bug affects the 8.1.x(LTS) versions. label Apr 9, 2024
@qw4990 qw4990 assigned qw4990 and unassigned hawkingrei May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/test severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants