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 TestAddGlobalIndexInIngest #58461

Open
D3Hunter opened this issue Dec 23, 2024 · 1 comment
Open

data race at TestAddGlobalIndexInIngest #58461

D3Hunter opened this issue Dec 23, 2024 · 1 comment
Labels
component/ddl This issue is related to DDL of TiDB. severity/minor type/bug The issue is confirmed as a bug.

Comments

@D3Hunter
Copy link
Contributor

D3Hunter commented Dec 23, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

the backend should only be unregistered once.

WARNING: DATA RACE
Read at 0x00c00bd59e30 by goroutine 24412:
  runtime.mapaccess2_fast64()
      GOROOT/src/runtime/map_fast64.go:62 +0x0
  github.com/pingcap/tidb/pkg/ddl/ingest.(*MockBackendCtxMgr).Unregister()
      pkg/ddl/ingest/mock.go:77 +0x88
  github.com/pingcap/tidb/pkg/ddl.convertAddIdxJob2RollbackJob()
      pkg/ddl/rollingback.go:98 +0x90c
  github.com/pingcap/tidb/pkg/ddl.runReorgJobAndHandleErr()
      pkg/ddl/index.go:1542 +0x1188
  github.com/pingcap/tidb/pkg/ddl.runIngestReorgJobDist()
      pkg/ddl/index.go:1425 +0xb7
  github.com/pingcap/tidb/pkg/ddl.doReorgWorkForCreateIndex()
      pkg/ddl/index.go:1360 +0x1557
  github.com/pingcap/tidb/pkg/ddl.doReorgWorkForCreateIndexMultiSchema()
      pkg/ddl/index.go:1314 +0x105
  github.com/pingcap/tidb/pkg/ddl.(*worker).onCreateIndex()
      pkg/ddl/index.go:1053 +0xb2d
  github.com/pingcap/tidb/pkg/ddl.(*worker).runOneJobStep()
      pkg/ddl/job_worker.go:931 +0xed6
  github.com/pingcap/tidb/pkg/ddl.onMultiSchemaChange()
      pkg/ddl/multi_schema_change.go:64 +0x713
  github.com/pingcap/tidb/pkg/ddl.(*worker).runOneJobStep()
      pkg/ddl/job_worker.go:1007 +0x1b44
  github.com/pingcap/tidb/pkg/ddl.(*worker).transitOneJobStep()
      pkg/ddl/job_worker.go:574 +0x585
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).transitOneJobStepAndWaitSync()
      pkg/ddl/job_scheduler.go:588 +0x6c6
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).deliveryJob.func1()
      pkg/ddl/job_scheduler.go:498 +0x364
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x97

Previous write at 0x00c00bd59e30 by goroutine 25640:
  runtime.mapdelete_fast64()
      GOROOT/src/runtime/map_fast64.go:304 +0x0
  github.com/pingcap/tidb/pkg/ddl/ingest.(*MockBackendCtxMgr).Unregister()
      pkg/ddl/ingest/mock.go:81 +0x3b1
  github.com/pingcap/tidb/pkg/ddl.(*readIndexExecutor).Cleanup()
      pkg/ddl/backfilling_read_index.go:155 +0xbe
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*BaseTaskExecutor).cleanStepExecutor()
      pkg/disttask/framework/taskexecutor/task_executor.go:376 +0xbc
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*BaseTaskExecutor).Run.func1()
      pkg/disttask/framework/taskexecutor/task_executor.go:223 +0x424
  runtime.deferreturn()
      GOROOT/src/runtime/panic.go:605 +0x5d
  github.com/pingcap/tidb/pkg/ddl.(*backfillDistExecutor).Run()
      <autogenerated>:1 +0x3e
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).startTaskExecutor.func2()
      pkg/disttask/framework/taskexecutor/manager.go:377 +0x109
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).RunWithLog.func1()
      pkg/util/wait_group_wrapper.go:171 +0xe3

Goroutine 24412 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:155 +0xf0
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).deliveryJob()
      pkg/ddl/job_scheduler.go:477 +0x5e4
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).loadAndDeliverJobs()
      pkg/ddl/job_scheduler.go:439 +0xaf1
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).schedule()
      pkg/ddl/job_scheduler.go:331 +0xbbb
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).scheduleLoop()
      pkg/ddl/job_scheduler.go:266 +0x75
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).scheduleLoop-fm()
      <autogenerated>:1 +0x33
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).RunWithLog.func1()
      pkg/util/wait_group_wrapper.go:171 +0xe3

Goroutine 25640 (finished) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).RunWithLog()
      pkg/util/wait_group_wrapper.go:164 +0xf0
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).startTaskExecutor()
      pkg/disttask/framework/taskexecutor/manager.go:369 +0xc98
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleExecutableTasks()
      pkg/disttask/framework/taskexecutor/manager.go:254 +0x256
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleTasks()
      pkg/disttask/framework/taskexecutor/manager.go:231 +0x557
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleTasksLoop()
      pkg/disttask/framework/taskexecutor/manager.go:185 +0x2c8
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleTasksLoop-fm()
      <autogenerated>:1 +0x33
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x97
==================

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master

@D3Hunter D3Hunter added component/ddl This issue is related to DDL of TiDB. type/bug The issue is confirmed as a bug. labels Dec 23, 2024
@D3Hunter
Copy link
Contributor Author

we will remove this backend mgr in #57770, so seems no need to fix this one

@tangenta tangenta added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Dec 23, 2024
@D3Hunter D3Hunter added severity/minor and removed affects-8.5 This bug affects the 8.5.x(LTS) versions. labels Dec 23, 2024
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. severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants