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 ddl.(*localRowCntListener).Written() #54373

Closed
Tracked by #41316
hawkingrei opened this issue Jul 1, 2024 · 0 comments · Fixed by #54484
Closed
Tracked by #41316

DATA RACE at the ddl.(*localRowCntListener).Written() #54373

hawkingrei opened this issue Jul 1, 2024 · 0 comments · Fixed by #54484
Labels
component/ddl This issue is related to DDL of TiDB. component/test severity/major 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
Read at 0x00c00c7cba30 by goroutine 65389:
  github.com/pingcap/tidb/pkg/ddl.(*localRowCntListener).Written()
      pkg/ddl/backfilling.go:762 +0x50
  github.com/pingcap/tidb/pkg/ddl.(*indexIngestLocalWorker).HandleTask()
      pkg/ddl/backfilling_operators.go:752 +0x2f6
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).handleTaskWithRecover()
      pkg/resourcemanager/pool/workerpool/workerpool.go:131 +0x26a
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).runAWorker.func1()
      pkg/resourcemanager/pool/workerpool/workerpool.go:147 +0xea
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x86
Previous write at 0x00c00c7cba30 by goroutine 65390:
  github.com/pingcap/tidb/pkg/ddl.(*localRowCntListener).Written()
      pkg/ddl/backfilling.go:762 +0x68
  github.com/pingcap/tidb/pkg/ddl.(*indexIngestLocalWorker).HandleTask()
      pkg/ddl/backfilling_operators.go:752 +0x2f6
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).handleTaskWithRecover()
      pkg/resourcemanager/pool/workerpool/workerpool.go:131 +0x26a
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).runAWorker.func1()
      pkg/resourcemanager/pool/workerpool/workerpool.go:147 +0xea
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x86
Goroutine 65389 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:155 +0xe4
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).runAWorker()
      pkg/resourcemanager/pool/workerpool/workerpool.go:139 +0x14f
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).Start()
      pkg/resourcemanager/pool/workerpool/workerpool.go:110 +0x22a
  github.com/pingcap/tidb/pkg/disttask/operator.(*AsyncOperator[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).Open()
      pkg/disttask/operator/operator.go:65 +0xa4
  github.com/pingcap/tidb/pkg/ddl.(*IndexIngestOperator).Open()
      <autogenerated>:1 +0x1f
  github.com/pingcap/tidb/pkg/disttask/operator.(*AsyncPipeline).Execute()
      pkg/disttask/operator/pipeline.go:29 +0xa1
  github.com/pingcap/tidb/pkg/ddl.(*ddlCtx).runAddIndexInLocalIngestMode()
      pkg/ddl/backfilling.go:728 +0x19f5
  github.com/pingcap/tidb/pkg/ddl.(*ddlCtx).writePhysicalTableRecord()
      pkg/ddl/backfilling.go:806 +0xae4
  github.com/pingcap/tidb/pkg/ddl.(*worker).addPhysicalTableIndex()
      pkg/ddl/index.go:1881 +0x5f0
  github.com/pingcap/tidb/pkg/ddl.(*worker).addTableIndex()
      pkg/ddl/index.go:1928 +0x1b0
  github.com/pingcap/tidb/pkg/ddl.runReorgJobAndHandleErr.func1()
      pkg/ddl/index.go:1055 +0x1b7
  github.com/pingcap/tidb/pkg/ddl.(*worker).runReorgJob.func1()
      pkg/ddl/reorg.go:255 +0xad
Goroutine 65390 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:155 +0xe4
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).runAWorker()
      pkg/resourcemanager/pool/workerpool/workerpool.go:139 +0x14f
  github.com/pingcap/tidb/pkg/resourcemanager/pool/workerpool.(*WorkerPool[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).Start()
      pkg/resourcemanager/pool/workerpool/workerpool.go:110 +0x22a
  github.com/pingcap/tidb/pkg/disttask/operator.(*AsyncOperator[go.shape.struct { ID int; Chunk *github.com/pingcap/tidb/pkg/util/chunk.Chunk; Err error; Done bool },go.shape.struct { ID int; Added int; Total int; Next github.com/pingcap/tidb/pkg/kv.Key }]).Open()
      pkg/disttask/operator/operator.go:65 +0xa4
  github.com/pingcap/tidb/pkg/ddl.(*IndexIngestOperator).Open()
      <autogenerated>:1 +0x1f
  github.com/pingcap/tidb/pkg/disttask/operator.(*AsyncPipeline).Execute()
      pkg/disttask/operator/pipeline.go:29 +0xa1
  github.com/pingcap/tidb/pkg/ddl.(*ddlCtx).runAddIndexInLocalIngestMode()
      pkg/ddl/backfilling.go:728 +0x19f5
  github.com/pingcap/tidb/pkg/ddl.(*ddlCtx).writePhysicalTableRecord()
      pkg/ddl/backfilling.go:806 +0xae4
  github.com/pingcap/tidb/pkg/ddl.(*worker).addPhysicalTableIndex()
      pkg/ddl/index.go:1881 +0x5f0
  github.com/pingcap/tidb/pkg/ddl.(*worker).addTableIndex()
      pkg/ddl/index.go:1928 +0x1b0
  github.com/pingcap/tidb/pkg/ddl.runReorgJobAndHandleErr.func1()
      pkg/ddl/index.go:1055 +0x1b7
  github.com/pingcap/tidb/pkg/ddl.(*worker).runReorgJob.func1()
      pkg/ddl/reorg.go:255 +0xad
================== 

4. What is your TiDB version? (Required)

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

Successfully merging a pull request may close this issue.

3 participants