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

datarace at (*Domain).InitDistTaskLoop() #54690

Closed
Tracked by #41316
AilinKid opened this issue Jul 17, 2024 · 0 comments · Fixed by #54701
Closed
Tracked by #41316

datarace at (*Domain).InitDistTaskLoop() #54690

AilinKid opened this issue Jul 17, 2024 · 0 comments · Fixed by #54701
Assignees
Labels
component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@AilinKid
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

==================
WARNING: DATA RACE
Read at 0x00c00708ea00 by main goroutine:
  github.com/pingcap/tidb/pkg/domain.(*Domain).InitDistTaskLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1592 +0x264
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3614 +0x1780
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/sessionctx/variable.parseSchemaCacheSize()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/varsutil.go:607 +0xe0
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func598()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3156 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func597()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3148 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadSysVarCacheLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1832 +0x6c
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3477 +0x620
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func209()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1102 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCacheIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:50 +0x110
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:61 +0x38
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3849 +0x204
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:2012 +0xf4
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:1523 +0x23c
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1775 +0xe0
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3470 +0x5ec
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3369 +0x23c
  main.createStoreAndDomain()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:420 +0x228
  main.main()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:326 +0x7d4

Previous write at 0x00c00708ea00 by goroutine 3284:
  github.com/pingcap/tidb/pkg/domain.(*Domain).loadStatsWorker()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:2453 +0x1b0
  github.com/pingcap/tidb/pkg/domain.(*Domain).loadStatsWorker-fm()
      <autogenerated>:1 +0x34
  github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:99 +0xa8

Goroutine 3284 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:94 +0x12c
  github.com/pingcap/tidb/pkg/domain.(*Domain).UpdateTableStatsLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:2314 +0x23c
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadAndUpdateStatsLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:2293 +0x6c
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3566 +0x13b4
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/sessionctx/variable.parseSchemaCacheSize()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/varsutil.go:607 +0xe0
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func598()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3156 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func597()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3148 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadSysVarCacheLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1832 +0x6c
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3477 +0x620
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func209()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1102 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCacheIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:50 +0x110
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:61 +0x38
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3849 +0x204
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:2012 +0xf4
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:1523 +0x23c
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1775 +0xe0
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3470 +0x5ec
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3369 +0x23c
  main.createStoreAndDomain()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:420 +0x228
  main.main()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:326 +0x7d4
==================
==================
WARNING: DATA RACE
Read at 0x00c00807e608 by main goroutine:
  runtime.growslice()
      /opt/homebrew/opt/go/libexec/src/runtime/slice.go:157 +0x0
  github.com/pingcap/tidb/pkg/domain.(*Domain).InitDistTaskLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1592 +0x298
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3614 +0x1780
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/sessionctx/variable.parseSchemaCacheSize()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/varsutil.go:607 +0xe0
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func598()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3156 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func597()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3148 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadSysVarCacheLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1832 +0x6c
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3477 +0x620
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func209()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1102 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCacheIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:50 +0x110
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:61 +0x38
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3849 +0x204
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:2012 +0xf4
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:1523 +0x23c
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1775 +0xe0
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3470 +0x5ec
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3369 +0x23c
  main.createStoreAndDomain()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:420 +0x228
  main.main()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:326 +0x7d4

Previous write at 0x00c00807e608 by goroutine 3284:
  github.com/pingcap/tidb/pkg/domain.(*Domain).loadStatsWorker()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:2453 +0x16c
  github.com/pingcap/tidb/pkg/domain.(*Domain).loadStatsWorker-fm()
      <autogenerated>:1 +0x34
  github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:99 +0xa8

Goroutine 3284 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:94 +0x12c
  github.com/pingcap/tidb/pkg/domain.(*Domain).UpdateTableStatsLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:2314 +0x23c
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadAndUpdateStatsLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:2293 +0x6c
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3566 +0x13b4
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/sessionctx/variable.parseSchemaCacheSize()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/varsutil.go:607 +0xe0
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func598()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3156 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func597()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:3148 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadSysVarCacheLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1832 +0x6c
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3477 +0x620
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func209()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1102 +0x40
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:146 +0x638
  github.com/pingcap/tidb/pkg/sessionctx/variable.glob..func208()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/sysvar.go:1095 +0x48
  github.com/pingcap/tidb/pkg/sessionctx/variable.(*SysVar).ValidateWithRelaxedValidation()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/sessionctx/variable/variable.go:365 +0x170
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:145 +0x5e4
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCacheIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:50 +0x110
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/sysvar_cache.go:61 +0x38
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3849 +0x204
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:2012 +0xf4
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:1523 +0x23c
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/domain/domain.go:1775 +0xe0
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3470 +0x5ec
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/pkg/session/session.go:3369 +0x23c
  main.createStoreAndDomain()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:420 +0x228
  main.main()
      /Users/arenatlx/go/src/github.com/pingcap/tidb/cmd/tidb-server/main.go:326 +0x7d4
==================

code

	do.cancelFns = append(do.cancelFns, cancel)

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

no datarace

3. What did you see instead (Required)

datarace

4. What is your TiDB version? (Required)

156f23a master

@AilinKid AilinKid added the type/bug The issue is confirmed as a bug. label Jul 17, 2024
@AilinKid AilinKid changed the title datarace at datarace at (*Domain).InitDistTaskLoop() Jul 17, 2024
@lance6716 lance6716 self-assigned this Jul 18, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label Jul 18, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 0ad8b84 Jul 18, 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/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