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

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
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants