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 mockOwnerOpValue #45106

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

DATA RACE at the mockOwnerOpValue #45106

hawkingrei opened this issue Jul 1, 2023 · 0 comments · Fixed by #45107
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
Write at 0x00000cfbfe4c by goroutine 30954:
  github.com/pingcap/tidb/owner.(*mockManager).SetOwnerOpValue()
      owner/mock.go:111 +0x30
  github.com/pingcap/tidb/ddl.(*ddl).doCheckClusterState()
      ddl/job_table.go:340 +0x87b
  github.com/pingcap/tidb/ddl.(*ddl).startDispatchLoop()
      ddl/job_table.go:269 +0x49c
  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 read at 0x00000cfbfe4c by goroutine 45:
  github.com/pingcap/tidb/owner.GetOwnerOpValue()
      owner/manager.go:418 +0x10c
  github.com/pingcap/tidb/session.syncUpgradeState()
      session/bootstrap.go:1233 +0x513
  github.com/pingcap/tidb/session.upgrade()
      session/bootstrap.go:1176 +0x4f3
  github.com/pingcap/tidb/session.runInBootstrapSession()
      session/session.go:3551 +0x26b
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3329 +0x304
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3293 +0x924
  session/bootstraptest/bootstraptest_test_test.TestUpgradeVersionForPausedJob()
      session/bootstraptest/bootstrap_upgrade_test.go:337 +0x92d
  github.com/pingcap/tidb/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      sessionctx/variable/variable.go:361 +0x1c7
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:146 +0x8c4
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1887 +0xa8
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3379 +0x6e4
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3743 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2152 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1666 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1830 +0x130
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3372 +0x687
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3293 +0x71
  github.com/pingcap/tidb/session.CreateStoreAndBootstrap()
      session/testutil.go:45 +0x5b
  session/bootstraptest/bootstraptest_test_test.TestUpgradeVersionForPausedJob()
      session/bootstraptest/bootstrap_upgrade_test.go:299 +0x4a
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 30954 (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:757 +0x4a9
  github.com/pingcap/tidb/ddl.(*ddl).Start()
      ddl/ddl.go:783 +0x8be
  github.com/pingcap/tidb/domain.(*Domain).Init()
      domain/domain.go:1207 +0x166c
  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:3600 +0x75
  github.com/pingcap/tidb/session.createSession()
      session/session.go:3592 +0x64
  github.com/pingcap/tidb/session.runInBootstrapSession()
      session/session.go:3542 +0x4b
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3329 +0x304
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3293 +0x924
  session/bootstraptest/bootstraptest_test_test.TestUpgradeVersionForPausedJob()
      session/bootstraptest/bootstrap_upgrade_test.go:337 +0x92d
  github.com/pingcap/tidb/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      sessionctx/variable/variable.go:361 +0x1c7
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:146 +0x8c4
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1887 +0xa8
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3379 +0x6e4
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3743 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2152 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1666 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1830 +0x130
  github.com/pingcap/tidb/session.bootstrapSessionImpl()
      session/session.go:3372 +0x687
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3293 +0x71
  github.com/pingcap/tidb/session.CreateStoreAndBootstrap()
      session/testutil.go:45 +0x5b
  session/bootstraptest/bootstraptest_test_test.TestUpgradeVersionForPausedJob()
      session/bootstraptest/bootstrap_upgrade_test.go:299 +0x4a
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 45 (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
  github.com/pingcap/tidb/testkit/testmain.(*testingM).Run()
      testkit/testmain/wrapper.go:27 +0x42
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x70
  session/bootstraptest/bootstraptest_test.TestMain()
      session/bootstraptest/main_test.go:62 +0x1009
  main.main()
      bazel-out/k8-fastbuild/bin/session/bootstraptest/bootstraptest_test_/testmain.go:125 +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.

1 participant