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 in the TestDDLCallback #44762

Closed
Tracked by #41316
hawkingrei opened this issue Jun 19, 2023 · 0 comments · Fixed by #44783
Closed
Tracked by #41316

DATA RACE in the TestDDLCallback #44762

hawkingrei opened this issue Jun 19, 2023 · 0 comments · Fixed by #44783
Labels
component/test severity/moderate 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 0x00c00bd3c768 by goroutine 27534:
  github.com/pingcap/tidb/ddl/util/callback.(*TestDDLCallback).OnGetJobBefore()
      ddl/util/callback/callback.go:145 +0x48
  github.com/pingcap/tidb/ddl.(*ddl).loadDDLJobAndRun()
      ddl/job_table.go:357 +0x3e2
  github.com/pingcap/tidb/ddl.(*ddl).startDispatchLoop()
      ddl/job_table.go:301 +0xc70
  github.com/pingcap/tidb/ddl.(*ddl).startDispatchLoop-fm()
      <autogenerated>:1 +0x39
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()
      util/wait_group_wrapper.go:154 +0x73
Previous write at 0x00c00bd3c768 by goroutine 48:
  ddl/pausetest/pausetest_test.TestResumeJobPositive()
      ddl/pausetest/pause_test.go:466 +0xaa8
  github.com/pingcap/tidb/session.runStmt()
      session/session.go:2400 +0x62f
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2250 +0x1405
  github.com/pingcap/tidb/testkit.(*TestKit).ExecWithContext()
      testkit/testkit.go:324 +0x8ae
  github.com/pingcap/tidb/testkit.(*TestKit).MustExecWithContext()
      testkit/testkit.go:132 +0xb7
  github.com/pingcap/tidb/testkit.(*TestKit).MustExec()
      testkit/testkit.go:127 +0x138
  ddl/pausetest/pausetest_test.TestResumeJobPositive()
      ddl/pausetest/pause_test.go:431 +0x207
  github.com/pingcap/tidb/session.runStmt()
      session/session.go:2400 +0x62f
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2250 +0x1405
  github.com/pingcap/tidb/testkit.(*TestKit).ExecWithContext()
      testkit/testkit.go:324 +0x8ae
  github.com/pingcap/tidb/testkit.(*TestKit).MustExecWithContext()
      testkit/testkit.go:132 +0xb7
  github.com/pingcap/tidb/testkit.(*TestKit).MustExec()
      testkit/testkit.go:127 +0x138
  ddl/pausetest/pausetest_test.TestResumeJobPositive()
      ddl/pausetest/pause_test.go:430 +0x1e7
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:146 +0x8c4
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1774 +0xa8
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3357 +0x6e4
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3721 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2130 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1666 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1717 +0x130
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3350 +0x687
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3271 +0xb4
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:218 +0x9b
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomainWithSchemaLease()
      testkit/mockstore.go:243 +0xe9
  ddl/pausetest/pausetest_test.TestResumeJobPositive()
      ddl/pausetest/pause_test.go:400 +0x5d
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 27534 (running) created at:
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run()
      util/wait_group_wrapper.go:152 +0xe4
  github.com/pingcap/tidb/ddl.(*ddl).prepareWorkers4ConcurrencyDDL()
      ddl/ddl.go:756 +0x4a9
  github.com/pingcap/tidb/ddl.(*ddl).Start()
      ddl/ddl.go:782 +0x8be
  github.com/pingcap/tidb/domain.(*Domain).Init()
      domain/domain.go:1206 +0x16cc
  github.com/pingcap/tidb/session.(*domainMap).Get.func1()
      session/tidb.go:93 +0x676
  github.com/pingcap/tidb/util.RunWithRetry()
      util/misc.go:69 +0x93
  github.com/pingcap/tidb/session.(*domainMap).Get()
      session/tidb.go:79 +0x2d2
  github.com/pingcap/tidb/session.createSessionWithOpt()
      session/session.go:3578 +0x75
  github.com/pingcap/tidb/session.createSession()
      session/session.go:3570 +0x38
  github.com/pingcap/tidb/session.createSessionsImpl()
      session/session.go:3555 +0x81
  github.com/pingcap/tidb/session.createSessions()
      session/session.go:3542 +0x4b
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3317 +0x3e6
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3271 +0xb4
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:218 +0x9b
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomainWithSchemaLease()
      testkit/mockstore.go:243 +0xe9
  ddl/pausetest/pausetest_test.TestResumeJobPositive()
      ddl/pausetest/pause_test.go:400 +0x5d
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 48 (running) created at:
  testing.(*T).Run()
      GOROOT/src/testing/testing.go:1629 +0x805
  testing.runTests.func1()
      GOROOT/src/testing/testing.go:2036 +0x8d
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.runTests()
      GOROOT/src/testing/testing.go:2034 +0x87c
  testing.(*M).Run()
      GOROOT/src/testing/testing.go:1906 +0xb44
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x70
  ddl/pausetest/pausetest_test.TestMain()
      ddl/pausetest/main_test.go:44 +0x45c
  main.main()
      bazel-out/k8-fastbuild/bin/ddl/pausetest/pausetest_test_/testmain.go:108 +0x5e8
================== 

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/test severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants