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 schematracker.Checker #43516

Closed
Tracked by #41316
hawkingrei opened this issue May 4, 2023 · 0 comments · Fixed by #43517
Closed
Tracked by #41316

DATA RACE in the schematracker.Checker #43516

hawkingrei opened this issue May 4, 2023 · 0 comments · Fixed by #43517
Labels
severity/moderate sig/sql-infra SIG: SQL Infra 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 0x00c019854c18 by goroutine 120718:
  github.com/pingcap/tidb/ddl/schematracker.(*Checker).OwnerManager()
      <autogenerated>:1 +0x47
  github.com/pingcap/tidb/domain.(*Domain).distTaskFrameworkLoop()
      domain/domain.go:1423 +0x27e
  github.com/pingcap/tidb/domain.(*Domain).InitDistTaskLoop.func1()
      domain/domain.go:1378 +0xaa
  github.com/pingcap/tidb/util.(*WaitGroupEnhancedWrapper).Run.func1()
      util/wait_group_wrapper.go:96 +0xb7
Previous write at 0x00c019854c18 by goroutine 93988:
  github.com/pingcap/tidb/ddl/schematracker.(*Checker).Disable()
      ddl/schematracker/checker.go:74 +0x611
  github.com/pingcap/tidb/ddl_test.TestChangingTableCharset()
      ddl/db_integration_test.go:820 +0x5fd
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:146 +0x8c4
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1586 +0xa8
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3340 +0x6d3
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3687 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2103 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1641 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1530 +0x130
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3333 +0x684
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:85 +0xac
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:70 +0xe9
  github.com/pingcap/tidb/ddl_test.TestChangingTableCharset()
      ddl/db_integration_test.go:751 +0x7c
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 120718 (running) created at:
  github.com/pingcap/tidb/util.(*WaitGroupEnhancedWrapper).Run()
      util/wait_group_wrapper.go:91 +0x147
  github.com/pingcap/tidb/domain.(*Domain).InitDistTaskLoop()
      domain/domain.go:1374 +0x353
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3487 +0x1f64
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:147 +0x950
  github.com/pingcap/tidb/sessionctx/variable.glob..func179()
      sessionctx/variable/sysvar.go:929 +0x5e
  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:1586 +0xa8
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3340 +0x6d3
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3687 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2103 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1641 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1530 +0x130
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3333 +0x684
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:85 +0xac
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:70 +0xe9
  github.com/pingcap/tidb/ddl_test.TestChangingTableCharset()
      ddl/db_integration_test.go:751 +0x7c
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 93988 (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
  github.com/pingcap/tidb/ddl_test.TestMain()
      ddl/main_test.go:73 +0x9bd
  main.main()
      bazel-out/k8-fastbuild/bin/ddl/ddl_test_/testmain.go:1382 +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
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant