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 TestAddIndexIngestMultiSchemaChange #48191

Closed
Tracked by #41316
lance6716 opened this issue Nov 1, 2023 · 0 comments · Fixed by #48888
Closed
Tracked by #41316

Data race TestAddIndexIngestMultiSchemaChange #48191

lance6716 opened this issue Nov 1, 2023 · 0 comments · Fixed by #48888

Comments

@lance6716
Copy link
Contributor

lance6716 commented Nov 1, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

WARNING: DATA RACE
Write at 0x00c01a5becf0 by goroutine 94057:
  github.com/pingcap/tidb/pkg/parser/ast.(*ColumnNameExpr).Accept()
      pkg/parser/ast/expressions.go:600 +0x107
  github.com/pingcap/tidb/pkg/parser/ast.(*BinaryOperationExpr).Accept()
      pkg/parser/ast/expressions.go:211 +0xcd
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewriteExprNode()
      pkg/planner/core/expression_rewriter.go:201 +0x1a5
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewriteWithPreprocess()
      pkg/planner/core/expression_rewriter.go:146 +0x2ed
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewrite()
      pkg/planner/core/expression_rewriter.go:114 +0xd5
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildDataSource()
      pkg/planner/core/logical_plan_builder.go:5255 +0x4f13
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildResultSetNode()
      pkg/planner/core/logical_plan_builder.go:530 +0x484
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildJoin()
      pkg/planner/core/logical_plan_builder.go:1013 +0x1376
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildResultSetNode()
      pkg/planner/core/logical_plan_builder.go:516 +0x112
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildTableRefs()
      pkg/planner/core/logical_plan_builder.go:508 +0x12b
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildSelect()
      pkg/planner/core/logical_plan_builder.go:4377 +0xe4d
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).Build()
      pkg/planner/core/planbuilder.go:851 +0xa8c
  github.com/pingcap/tidb/pkg/planner.buildLogicalPlan()
      pkg/planner/optimize.go:575 +0x32f
  github.com/pingcap/tidb/pkg/planner.optimize()
      pkg/planner/optimize.go:495 +0x626
  github.com/pingcap/tidb/pkg/planner.Optimize()
      pkg/planner/optimize.go:353 +0x17b7
  github.com/pingcap/tidb/pkg/executor.(*Compiler).Compile()
      pkg/executor/compiler.go:100 +0x87d
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2211 +0xe96
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      pkg/session/session.go:1645 +0x35a
  github.com/pingcap/tidb/pkg/executor.getCheckSum()
      pkg/executor/executor.go:2324 +0x12d
  github.com/pingcap/tidb/pkg/executor.(*checkIndexWorker).HandleTask()
      pkg/executor/executor.go:2466 +0x22e4
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).handleTaskWithRecover()
      pkg/resourcemanager/pool/workerpool/workerpool.go:131 +0x22a
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).runAWorker.func1()
      pkg/resourcemanager/pool/workerpool/workerpool.go:147 +0xb5
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:154 +0x84
Previous write at 0x00c01a5becf0 by goroutine 94058:
  github.com/pingcap/tidb/pkg/parser/ast.(*ColumnNameExpr).Accept()
      pkg/parser/ast/expressions.go:600 +0x107
  github.com/pingcap/tidb/pkg/parser/ast.(*BinaryOperationExpr).Accept()
      pkg/parser/ast/expressions.go:211 +0xcd
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewriteExprNode()
      pkg/planner/core/expression_rewriter.go:201 +0x1a5
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewriteWithPreprocess()
      pkg/planner/core/expression_rewriter.go:146 +0x2ed
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewrite()
      pkg/planner/core/expression_rewriter.go:114 +0xd5
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildDataSource()
      pkg/planner/core/logical_plan_builder.go:5255 +0x4f13
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildResultSetNode()
      pkg/planner/core/logical_plan_builder.go:530 +0x484
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildJoin()
      pkg/planner/core/logical_plan_builder.go:1013 +0x1376
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildResultSetNode()
      pkg/planner/core/logical_plan_builder.go:516 +0x112
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildTableRefs()
      pkg/planner/core/logical_plan_builder.go:508 +0x12b
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildSelect()
      pkg/planner/core/logical_plan_builder.go:4377 +0xe4d
  github.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).Build()
      pkg/planner/core/planbuilder.go:851 +0xa8c
  github.com/pingcap/tidb/pkg/planner.buildLogicalPlan()
      pkg/planner/optimize.go:575 +0x32f
  github.com/pingcap/tidb/pkg/planner.optimize()
      pkg/planner/optimize.go:495 +0x626
  github.com/pingcap/tidb/pkg/planner.Optimize()
      pkg/planner/optimize.go:353 +0x17b7
  github.com/pingcap/tidb/pkg/executor.(*Compiler).Compile()
      pkg/executor/compiler.go:100 +0x87d
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2211 +0xe96
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      pkg/session/session.go:1645 +0x35a
  github.com/pingcap/tidb/pkg/executor.getCheckSum()
      pkg/executor/executor.go:2324 +0x12d
  github.com/pingcap/tidb/pkg/executor.(*checkIndexWorker).HandleTask()
      pkg/executor/executor.go:2466 +0x22e4
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).handleTaskWithRecover()
      pkg/resourcemanager/pool/workerpool/workerpool.go:131 +0x22a
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).runAWorker.func1()
      pkg/resourcemanager/pool/workerpool/workerpool.go:147 +0xb5
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:154 +0x84
Goroutine 94057 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:152 +0xf0
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).runAWorker()
      pkg/resourcemanager/pool/workerpool/workerpool.go:139 +0x179
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).Start()
      pkg/resourcemanager/pool/workerpool/workerpool.go:110 +0x2b0
  github.com/pingcap/tidb/pkg/executor.(*FastCheckTableExec).Next()
      pkg/executor/executor.go:2708 +0x2a9
  github.com/pingcap/tidb/pkg/executor/internal/exec.Next()
      pkg/executor/internal/exec/executor.go:278 +0x3b5
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).next()
      pkg/executor/adapter.go:1226 +0x94
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelayExecutor()
      pkg/executor/adapter.go:971 +0x559
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelay()
      pkg/executor/adapter.go:797 +0x41b
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).Exec()
      pkg/executor/adapter.go:578 +0x1437
  github.com/pingcap/tidb/pkg/session.runStmt()
      pkg/session/session.go:2421 +0x701
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2271 +0x1bc4
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext()
      pkg/testkit/testkit.go:363 +0x8eb
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExecWithContext()
      pkg/testkit/testkit.go:135 +0xbc
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExec()
      pkg/testkit/testkit.go:130 +0x134
  github.com/pingcap/tidb/pkg/ddl/ingest_test.TestAddIndexIngestMultiSchemaChange()
      pkg/ddl/ingest/integration_test.go:310 +0x2e9
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      pkg/session/session.go:3368 +0x7aa
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      pkg/domain/sysvar_cache.go:62 +0x64
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      pkg/session/session.go:3740 +0x130
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2132 +0x15a
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      pkg/session/session.go:1645 +0x35a
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      pkg/domain/domain.go:1630 +0x11a
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      pkg/session/session.go:3361 +0x74a
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      pkg/session/session.go:3282 +0x4b
  github.com/pingcap/tidb/pkg/testkit.bootstrap()
      pkg/testkit/mockstore.go:227 +0x86
  github.com/pingcap/tidb/pkg/testkit.CreateMockStoreAndDomain()
      pkg/testkit/mockstore.go:200 +0xde
  github.com/pingcap/tidb/pkg/testkit.CreateMockStore()
      pkg/testkit/mockstore.go:68 +0x41d
  github.com/pingcap/tidb/pkg/ddl/ingest_test.TestAddIndexIngestMultiSchemaChange()
      pkg/ddl/ingest/integration_test.go:283 +0x49
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x238
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1648 +0x44
Goroutine 94058 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:152 +0xf0
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).runAWorker()
      pkg/resourcemanager/pool/workerpool/workerpool.go:139 +0x179
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { github.com/pingcap/tidb/pkg/executor.indexOffset int },go.shape.struct {}]).Start()
      pkg/resourcemanager/pool/workerpool/workerpool.go:110 +0x2b0
  github.com/pingcap/tidb/pkg/executor.(*FastCheckTableExec).Next()
      pkg/executor/executor.go:2708 +0x2a9
  github.com/pingcap/tidb/pkg/executor/internal/exec.Next()
      pkg/executor/internal/exec/executor.go:278 +0x3b5
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).next()
      pkg/executor/adapter.go:1226 +0x94
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelayExecutor()
      pkg/executor/adapter.go:971 +0x559
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelay()
      pkg/executor/adapter.go:797 +0x41b
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).Exec()
      pkg/executor/adapter.go:578 +0x1437
  github.com/pingcap/tidb/pkg/session.runStmt()
      pkg/session/session.go:2421 +0x701
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2271 +0x1bc4
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext()
      pkg/testkit/testkit.go:363 +0x8eb
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExecWithContext()
      pkg/testkit/testkit.go:135 +0xbc
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExec()
      pkg/testkit/testkit.go:130 +0x134
  github.com/pingcap/tidb/pkg/ddl/ingest_test.TestAddIndexIngestMultiSchemaChange()
      pkg/ddl/ingest/integration_test.go:310 +0x2e9
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      pkg/session/session.go:3368 +0x7aa
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      pkg/domain/sysvar_cache.go:62 +0x64
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      pkg/session/session.go:3740 +0x130
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2132 +0x15a
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      pkg/session/session.go:1645 +0x35a
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      pkg/domain/domain.go:1630 +0x11a
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      pkg/session/session.go:3361 +0x74a
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      pkg/session/session.go:3282 +0x4b
  github.com/pingcap/tidb/pkg/testkit.bootstrap()
      pkg/testkit/mockstore.go:227 +0x86
  github.com/pingcap/tidb/pkg/testkit.CreateMockStoreAndDomain()
      pkg/testkit/mockstore.go:200 +0xde
  github.com/pingcap/tidb/pkg/testkit.CreateMockStore()
      pkg/testkit/mockstore.go:68 +0x41d
  github.com/pingcap/tidb/pkg/ddl/ingest_test.TestAddIndexIngestMultiSchemaChange()
      pkg/ddl/ingest/integration_test.go:283 +0x49
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x238
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1648 +0x44
==================

https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fghpr_unit_test/detail/ghpr_unit_test/36542/pipeline

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@lance6716 lance6716 added the type/bug The issue is confirmed as a bug. label Nov 1, 2023
@jebter jebter added component/test component/ddl This issue is related to DDL of TiDB. labels Nov 2, 2023
@tangenta tangenta self-assigned this Nov 3, 2023
@ti-chi-bot ti-chi-bot bot added 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 may-affects-7.5 labels Nov 24, 2023
ti-chi-bot bot pushed a commit that referenced this issue Nov 27, 2023
ti-chi-bot bot pushed a commit that referenced this issue Dec 8, 2023
ti-chi-bot bot pushed a commit that referenced this issue Feb 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.

3 participants