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 TestAdminCheckGlobalIndexDuringDDL #53802

Closed
hawkingrei opened this issue Jun 4, 2024 · 0 comments · Fixed by #53817
Closed

DATA RACE in the TestAdminCheckGlobalIndexDuringDDL #53802

hawkingrei opened this issue Jun 4, 2024 · 0 comments · Fixed by #53817
Assignees
Labels
severity/minor 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
Write at 0x00c006ac4290 by goroutine 40210:
  github.com/pingcap/tidb/pkg/executor.ResetContextOfStmt()
      pkg/executor/executor.go:2056 +0x3fb3
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2016 +0x285
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext()
      pkg/testkit/testkit.go:383 +0xe29
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).Exec()
      pkg/testkit/testkit.go:356 +0xb5
  pkg/executor/test/admintest/admintest_test.TestAdminCheckGlobalIndexDuringDDL.func1()
      pkg/executor/test/admintest/admin_test.go:2066 +0x79
  github.com/pingcap/tidb/pkg/ddl/util/callback.(*TestDDLCallback).OnJobUpdated()
      pkg/ddl/util/callback/callback.go:124 +0x1f2
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).delivery2Worker.func1()
      pkg/ddl/job_table.go:593 +0xf68
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x86
Previous read at 0x00c006ac4290 by goroutine 63:
  github.com/pingcap/tidb/pkg/ddl.(*ddl).DoDDLJob()
      pkg/ddl/ddl.go:1196 +0xfa4
  github.com/pingcap/tidb/pkg/ddl.(*ddl).TruncateTablePartition()
      pkg/ddl/ddl_api.go:5050 +0xdd8
  github.com/pingcap/tidb/pkg/ddl.(*ddl).AlterTable()
      pkg/ddl/ddl_api.go:3935 +0x24be
  github.com/pingcap/tidb/pkg/executor.(*DDLExec).executeAlterTable()
      pkg/executor/ddl.go:388 +0x2a2
  github.com/pingcap/tidb/pkg/executor.(*DDLExec).Next()
      pkg/executor/ddl.go:152 +0x38d
  github.com/pingcap/tidb/pkg/executor/internal/exec.Next()
      pkg/executor/internal/exec/executor.go:410 +0x3b0
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).next()
      pkg/executor/adapter.go:1211 +0x84
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelayExecutor()
      pkg/executor/adapter.go:960 +0x55b
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).handleNoDelay()
      pkg/executor/adapter.go:794 +0x3ca
  github.com/pingcap/tidb/pkg/executor.(*ExecStmt).Exec()
      pkg/executor/adapter.go:559 +0x1326
  github.com/pingcap/tidb/pkg/session.runStmt()
      pkg/session/session.go:2285 +0x5d3
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2146 +0x1ac4
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext()
      pkg/testkit/testkit.go:383 +0xe29
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExecWithContext()
      pkg/testkit/testkit.go:155 +0xab
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExec()
      pkg/testkit/testkit.go:150 +0x128
  pkg/executor/test/admintest/admintest_test.TestAdminCheckGlobalIndexDuringDDL()
      pkg/executor/test/admintest/admin_test.go:2096 +0x6a4
  github.com/pingcap/failpoint.parseTerm()
      external/com_github_pingcap_failpoint/terms.go:149 +0x364
  github.com/pingcap/failpoint.parse()
      external/com_github_pingcap_failpoint/terms.go:126 +0xa5
  fmt.Sscanf()
      GOROOT/src/fmt/scan.go:114 +0x2d3
  github.com/pingcap/failpoint.parseVal()
      external/com_github_pingcap_failpoint/terms.go:285 +0x229
  fmt.(*ss).doScanf()
      GOROOT/src/fmt/scan.go:1230 +0x40e
  fmt.Fscanf()
      GOROOT/src/fmt/scan.go:143 +0xdc
  fmt.Sscanf()
      GOROOT/src/fmt/scan.go:114 +0x184
  github.com/pingcap/failpoint.parseVal()
      external/com_github_pingcap_failpoint/terms.go:279 +0xc4
  github.com/pingcap/failpoint.parseTerm()
      external/com_github_pingcap_failpoint/terms.go:149 +0x364
  github.com/pingcap/failpoint.parse()
      external/com_github_pingcap_failpoint/terms.go:126 +0xa5
  github.com/pingcap/failpoint.newTerms()
      external/com_github_pingcap_failpoint/terms.go:98 +0x3e
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:58 +0x3e
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x296
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:255 +0x65d
  pkg/executor/test/admintest/admintest_test.TestAdminCheckGlobalIndexDuringDDL()
      pkg/executor/test/admintest/admin_test.go:2095 +0x65e
  github.com/pingcap/tidb/pkg/session.runStmt()
      pkg/session/session.go:2285 +0x5d3
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2146 +0x1ac4
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext()
      pkg/testkit/testkit.go:383 +0xe29
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExecWithContext()
      pkg/testkit/testkit.go:155 +0xab
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExec()
      pkg/testkit/testkit.go:150 +0x128
  pkg/executor/test/admintest/admintest_test.TestAdminCheckGlobalIndexDuringDDL()
      pkg/executor/test/admintest/admin_test.go:2078 +0x485
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).ExecWithContext()
      pkg/testkit/testkit.go:383 +0xe29
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExecWithContext()
      pkg/testkit/testkit.go:155 +0xab
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).MustExec()
      pkg/testkit/testkit.go:150 +0x128
  github.com/pingcap/tidb/pkg/testkit.(*TestKit).RefreshSession()
      pkg/testkit/testkit.go:122 +0x104
  github.com/pingcap/tidb/pkg/testkit.NewTestKit()
      pkg/testkit/testkit.go:84 +0x49d
  pkg/executor/test/admintest/admintest_test.TestAdminCheckGlobalIndexDuringDDL()
      pkg/executor/test/admintest/admin_test.go:2059 +0xbe
  github.com/pingcap/tidb/pkg/domain.(*Domain).rebuildSysVarCache()
      pkg/domain/sysvar_cache.go:145 +0x904
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadSysVarCacheLoop()
      pkg/domain/domain.go:1755 +0x93
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      pkg/session/session.go:3426 +0x864
  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()
      pkg/domain/sysvar_cache.go:61 +0x50
  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()
      pkg/session/session.go:3794 +0x2ce
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()
      pkg/session/session.go:2008 +0x184
  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()
      pkg/session/session.go:1519 +0x3b9
  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()
      pkg/domain/domain.go:1698 +0x108
  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()
      pkg/session/session.go:3419 +0x804
  github.com/pingcap/tidb/pkg/session.BootstrapSession()
      pkg/session/session.go:3318 +0xad
  github.com/pingcap/tidb/pkg/testkit.bootstrap()
      pkg/testkit/mockstore.go:254 +0x94
  github.com/pingcap/tidb/pkg/testkit.CreateMockStoreAndDomain()
      pkg/testkit/mockstore.go:225 +0xd2
  pkg/executor/test/admintest/admintest_test.TestAdminCheckGlobalIndexDuringDDL()
      pkg/executor/test/admintest/admin_test.go:2057 +0x4c
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1648 +0x44
Goroutine 40210 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:155 +0xe4
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).delivery2Worker()
      pkg/ddl/job_table.go:511 +0x193
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).loadDDLJobAndRun()
      pkg/ddl/job_table.go:467 +0x4dc
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).startDispatchLoop()
      pkg/ddl/job_table.go:401 +0xe05
  github.com/pingcap/tidb/pkg/ddl.(*jobScheduler).startDispatchLoop-fm()
      <autogenerated>:1 +0x33
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).RunWithLog.func1()
      pkg/util/wait_group_wrapper.go:171 +0xd0
Goroutine 63 (running) created at:
  testing.(*T).Run()
      GOROOT/src/testing/testing.go:1648 +0x845
  testing.runTests.func1()
      GOROOT/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x261
  testing.runTests()
      GOROOT/src/testing/testing.go:2052 +0x8ad
  testing.(*M).Run()
      GOROOT/src/testing/testing.go:1925 +0xcd7
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x64
  pkg/executor/test/admintest/admintest_test.TestMain()
      pkg/executor/test/admintest/main_test.go:49 +0x784
  main.main()
      bazel-out/k8-fastbuild/bin/pkg/executor/test/admintest/admintest_test_/testmain.go:173 +0x6dc
================== 

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/minor 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.

2 participants