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 Session.RunInTxn() #42985

Closed
Tracked by #41316
hawkingrei opened this issue Apr 12, 2023 · 1 comment
Closed
Tracked by #41316

DATA RACE in the Session.RunInTxn() #42985

hawkingrei opened this issue Apr 12, 2023 · 1 comment
Labels
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 0x00000c1d2918 by goroutine 248905:
  github.com/pingcap/tidb/ddl/internal/session.(*Session).RunInTxn()
      ddl/internal/session/session.go:118 +0xf9
  github.com/pingcap/tidb/ddl.GetAndMarkBackfillJobsForOneEle()
      ddl/job_table.go:725 +0x132
  github.com/pingcap/tidb/ddl.GetTasks()
      ddl/dist_backfilling.go:322 +0x10c
  github.com/pingcap/tidb/ddl_test.TestGetTasks.func6()
      ddl/job_table_test.go:827 +0x217
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x44
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x276
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0x184
  github.com/pingcap/tidb/ddl_test.TestGetTasks.func6()
      ddl/job_table_test.go:826 +0x185
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()
      util/wait_group_wrapper.go:154 +0x73
Previous write at 0x00000c1d2918 by goroutine 248904:
  github.com/pingcap/tidb/ddl/internal/session.(*Session).RunInTxn()
      ddl/internal/session/session.go:116 +0x144
  github.com/pingcap/tidb/ddl.GetAndMarkBackfillJobsForOneEle()
      ddl/job_table.go:725 +0x132
  github.com/pingcap/tidb/ddl.GetTasks()
      ddl/dist_backfilling.go:322 +0x10c
  github.com/pingcap/tidb/ddl_test.TestGetTasks.func5()
      ddl/job_table_test.go:817 +0x151
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x44
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x276
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0xb0
  github.com/pingcap/tidb/ddl_test.TestGetTasks.func5()
      ddl/job_table_test.go:815 +0xb1
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()
      util/wait_group_wrapper.go:154 +0x73
Goroutine 248905 (running) created at:
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run()
      util/wait_group_wrapper.go:152 +0xe4
  github.com/pingcap/tidb/ddl_test.TestGetTasks()
      ddl/job_table_test.go:822 +0x13de
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x44
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x276
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0xfad
  github.com/pingcap/tidb/ddl_test.TestGetTasks()
      ddl/job_table_test.go:807 +0xfae
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:146 +0x8c4
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1580 +0xa8
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3325 +0x6d3
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3672 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2103 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1638 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1524 +0x130
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3318 +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.TestGetTasks()
      ddl/job_table_test.go:742 +0xf0
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Goroutine 248904 (running) created at:
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run()
      util/wait_group_wrapper.go:152 +0xe4
  github.com/pingcap/tidb/ddl_test.TestGetTasks()
      ddl/job_table_test.go:814 +0x11fd
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x44
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x276
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0xfad
  github.com/pingcap/tidb/ddl_test.TestGetTasks()
      ddl/job_table_test.go:807 +0xfae
  github.com/pingcap/tidb/domain.(*Domain).rebuildSysVarCache()
      domain/sysvar_cache.go:146 +0x8c4
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1580 +0xa8
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3325 +0x6d3
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x5c
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3672 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2103 +0x145
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1638 +0x31b
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1524 +0x130
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3318 +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.TestGetTasks()
      ddl/job_table_test.go:742 +0xf0
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
================== 

https://prow.hawkingrei.com/view/gs/prowpingcap/logs/tidb_race/1645947116700307456

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Apr 12, 2023
@hawkingrei hawkingrei changed the title DATA RACE in the DATA RACE in the Session.RunInTxn() Apr 12, 2023
@tangenta
Copy link
Contributor

GetAndMarkBackfillJobsForOneEle has been removed by #42981.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants