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

send on closed channel in the TestGetDefaultValueOfColumn #42653

Closed
Tracked by #41316
hawkingrei opened this issue Mar 28, 2023 · 1 comment · Fixed by #42682
Closed
Tracked by #41316

send on closed channel in the TestGetDefaultValueOfColumn #42653

hawkingrei opened this issue Mar 28, 2023 · 1 comment · Fixed by #42682
Assignees
Labels
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 0x00c04b5a57b0 by goroutine 423780:
  runtime.chansend()
      GOROOT/src/runtime/chan.go:160 +0x0
  github.com/pingcap/tidb/ddl.(*backfillWorker).run.func1()
      ddl/backfilling.go:450 +0x14a
  github.com/pingcap/tidb/util.Recover()
      util/misc.go:114 +0xa9
  github.com/pingcap/tidb/ddl.(*backfillWorker).run.func2()
      ddl/backfilling.go:449 +0x54
  runtime.gopanic()
      GOROOT/src/runtime/panic.go:890 +0x262
  github.com/pingcap/tidb/ddl.(*backfillWorker).handleBackfillTask()
      ddl/backfilling.go:327 +0x49c
  github.com/pingcap/tidb/ddl.(*backfillWorker).run()
      ddl/backfilling.go:486 +0xa54
  github.com/pingcap/tidb/ddl.(*backfillScheduler).adjustWorkerSize.func1()
      ddl/backfilling_scheduler.go:202 +0x71
Previous write at 0x00c04b5a57b0 by goroutine 423772:
  runtime.closechan()
      GOROOT/src/runtime/chan.go:357 +0x0
  github.com/pingcap/tidb/ddl.(*backfillScheduler).close()
      ddl/backfilling_scheduler.go:263 +0x137
  github.com/pingcap/tidb/ddl.(*ddlCtx).writePhysicalTableRecord()
      ddl/backfilling.go:870 +0x14b3
  github.com/pingcap/tidb/ddl.(*worker).addPhysicalTableIndex()
      ddl/index.go:1928 +0x574
  github.com/pingcap/tidb/ddl.(*worker).addTableIndex()
      ddl/index.go:1958 +0x147
  github.com/pingcap/tidb/ddl.runReorgJobAndHandleErr.func1()
      ddl/index.go:993 +0x131
  github.com/pingcap/tidb/ddl.(*worker).runReorgJob.func1()
      ddl/reorg.go:210 +0x92
Goroutine 423780 (running) created at:
  github.com/pingcap/tidb/ddl.(*backfillScheduler).adjustWorkerSize()
      ddl/backfilling_scheduler.go:202 +0x124a
  github.com/pingcap/tidb/ddl.(*ddlCtx).writePhysicalTableRecord()
      ddl/backfilling.go:835 +0xc9e
  github.com/pingcap/tidb/ddl.(*worker).addPhysicalTableIndex()
      ddl/index.go:1928 +0x574
  github.com/pingcap/tidb/ddl.(*worker).addTableIndex()
      ddl/index.go:1958 +0x147
  github.com/pingcap/tidb/ddl.runReorgJobAndHandleErr.func1()
      ddl/index.go:993 +0x131
  github.com/pingcap/tidb/ddl.(*worker).runReorgJob.func1()
      ddl/reorg.go:210 +0x92
Goroutine 423772 (finished) created at:
  github.com/pingcap/tidb/ddl.(*worker).runReorgJob()
      ddl/reorg.go:208 +0x645
  github.com/pingcap/tidb/ddl.runReorgJobAndHandleErr()
      ddl/index.go:988 +0x79d
  github.com/pingcap/tidb/ddl.doReorgWorkForCreateIndex()
      ddl/index.go:818 +0xbc7
  github.com/pingcap/tidb/ddl.(*worker).onCreateIndex()
      ddl/index.go:676 +0x11ee
  github.com/pingcap/tidb/ddl.(*worker).runDDLJob()
      ddl/ddl_worker.go:1024 +0x7f5
  github.com/pingcap/tidb/ddl.(*worker).HandleDDLJobTable()
      ddl/ddl_worker.go:768 +0x691
  github.com/pingcap/tidb/ddl.(*ddl).delivery2worker.func1()
      ddl/job_table.go:285 +0xb65
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()
      util/wait_group_wrapper.go:154 +0x73
==================
panic: panic test [recovered]
	panic: send on closed channel
goroutine 423783 [running]:
github.com/pingcap/tidb/ddl.(*backfillWorker).run.func1()
	ddl/backfilling.go:450 +0x14b
github.com/pingcap/tidb/util.Recover({0x6f54012, 0x3}, {0x6f84eae, 0x12}, 0xc0292b3d58, 0x0)
	util/misc.go:114 +0xaa
panic({0x68637c0, 0x87aac00})
	GOROOT/src/runtime/panic.go:890 +0x263
github.com/pingcap/tidb/ddl.(*addIndexTxnWorker).BackfillData(0xc04b1b9c20, {0x0, {0x7f71c130eda8, 0xc04b3bd440}, 0x0, {0xc04b5ba200, 0x13, 0x100}, {0xc04b5f6210, 0x13, ...}, ...})
	ddl/index.go:1847 +0x4a6
github.com/pingcap/tidb/ddl.(*backfillWorker).handleBackfillTask(0xc04b5a7640, 0x2c?, 0xc04b5d2880, {0x87f1b20, 0xc04b1b9c20})
	ddl/backfilling.go:327 +0x49d
github.com/pingcap/tidb/ddl.(*backfillWorker).run(0xc04b5a7640, 0xc04b5b0f58?, {0x87f1b20, 0xc04b1b9c20}, 0xc04b17ea20)
	ddl/backfilling.go:486 +0xa55
created by github.com/pingcap/tidb/ddl.(*backfillScheduler).adjustWorkerSize
	ddl/backfilling_scheduler.go:202 +0x124b 

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Mar 28, 2023
@hawkingrei
Copy link
Member Author

@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. 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 labels Mar 29, 2023
@tangenta tangenta removed may-affects-4.0 This bug maybe affects 4.0.x versions. 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-5.0 This bug maybe affects 5.0.x versions. may-affects-6.1 may-affects-6.5 labels Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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