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 TestDispatcherExtGlobalSort #47941

Closed
Tracked by #41316
hawkingrei opened this issue Oct 24, 2023 · 0 comments
Closed
Tracked by #41316

DATA RACE in the TestDispatcherExtGlobalSort #47941

hawkingrei opened this issue Oct 24, 2023 · 0 comments
Labels
component/ddl This issue is related to DDL of TiDB. component/test severity/major 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 0x00c00568fe80 by goroutine 95:

  github.com/pingcap/tidb/pkg/executor.(*Compiler).Compile()

      pkg/executor/compiler.go:60 +0x2ce

  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()

      pkg/session/session.go:2211 +0xe96

  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()

      pkg/session/session.go:1645 +0x35a

  github.com/pingcap/tidb/pkg/executor/importer.GetJob()

      pkg/executor/importer/job.go:141 +0x1d6

  github.com/pingcap/tidb/pkg/disttask/importinto_test.TestDispatcherExtGlobalSort()

      pkg/disttask/importinto/dispatcher_testkit_test.go:348 +0x33de

  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:54 +0x3e

  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 +0x2c5c

  github.com/pingcap/tidb/pkg/disttask/importinto_test.TestDispatcherExtGlobalSort()

      pkg/disttask/importinto/dispatcher_testkit_test.go:319 +0x2c5d

  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()

      pkg/session/session.go:3368 +0x7aa

  github.com/pingcap/tidb/pkg/domain.(*Domain).GetSessionCache()

      pkg/domain/sysvar_cache.go:62 +0x64

  github.com/pingcap/tidb/pkg/session.(*session).loadCommonGlobalVariablesIfNeeded()

      pkg/session/session.go:3740 +0x130

  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()

      pkg/session/session.go:2132 +0x15a

  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()

      pkg/session/session.go:1645 +0x35a

  github.com/pingcap/tidb/pkg/domain.(*Domain).LoadPrivilegeLoop()

      pkg/domain/domain.go:1629 +0x11a

  github.com/pingcap/tidb/pkg/session.bootstrapSessionImpl()

      pkg/session/session.go:3361 +0x74a

  github.com/pingcap/tidb/pkg/session.BootstrapSession()

      pkg/session/session.go:3282 +0x4b

  github.com/pingcap/tidb/pkg/testkit.bootstrap()

      pkg/testkit/mockstore.go:227 +0x86

  github.com/pingcap/tidb/pkg/testkit.CreateMockStoreAndDomain()

      pkg/testkit/mockstore.go:200 +0xde

  github.com/pingcap/tidb/pkg/testkit.CreateMockStore()

      pkg/testkit/mockstore.go:68 +0x41d

  github.com/pingcap/tidb/pkg/disttask/importinto_test.TestDispatcherExtGlobalSort()

      pkg/disttask/importinto/dispatcher_testkit_test.go:153 +0x4c

  testing.tRunner()

      GOROOT/src/testing/testing.go:1595 +0x238

  testing.(*T).Run.func1()

      GOROOT/src/testing/testing.go:1648 +0x44


Previous write at 0x00c00568fe80 by goroutine 58088:

  github.com/pingcap/tidb/pkg/executor.(*Compiler).Compile()

      pkg/executor/compiler.go:60 +0x2ce

  github.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt()

      pkg/session/session.go:2211 +0xe96

  github.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal()

      pkg/session/session.go:1645 +0x35a

  github.com/pingcap/tidb/pkg/executor/importer.Job2Step()

      pkg/executor/importer/job.go:242 +0x229

  github.com/pingcap/tidb/pkg/disttask/importinto.job2Step.func1.1()

      pkg/disttask/importinto/dispatcher.go:657 +0xc6

  github.com/pingcap/tidb/pkg/disttask/framework/storage.(*TaskManager).WithNewSession()

      pkg/disttask/framework/storage/task_table.go:143 +0x16b

  github.com/pingcap/tidb/pkg/disttask/importinto.job2Step.func1()

      pkg/disttask/importinto/dispatcher.go:655 +0xc9

  github.com/pingcap/tidb/pkg/disttask/framework/handle.RunWithRetry()

      pkg/disttask/framework/handle/handle.go:174 +0xe4

  github.com/pingcap/tidb/pkg/disttask/importinto.job2Step()

      pkg/disttask/importinto/dispatcher.go:653 +0x21a

  github.com/pingcap/tidb/pkg/disttask/importinto.(*ImportDispatcherExt).OnNextSubtasksBatch()

      pkg/disttask/importinto/dispatcher.go:271 +0x1318

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*BaseDispatcher).onNextStage()

      pkg/disttask/framework/dispatcher/dispatcher.go:548 +0x8c1

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*BaseDispatcher).onPending()

      pkg/disttask/framework/dispatcher/dispatcher.go:319 +0x2c4

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*BaseDispatcher).scheduleTask()

      pkg/disttask/framework/dispatcher/dispatcher.go:212 +0x16b9

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*BaseDispatcher).ExecuteTask()

      pkg/disttask/framework/dispatcher/dispatcher.go:132 +0x2b2

  github.com/pingcap/tidb/pkg/disttask/importinto.(*importDispatcher).ExecuteTask()

      <autogenerated>:1 +0x3e

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*Manager).startDispatcher.func1()

      pkg/disttask/framework/dispatcher/dispatcher_manager.go:282 +0x3ed

  github.com/pingcap/tidb/pkg/resourcemanager/pool/spool.(*Pool).run.func1()

      pkg/resourcemanager/pool/spool/spool.go:145 +0x93


Goroutine 95 (running) created at:

  testing.(*T).Run()

      GOROOT/src/testing/testing.go:1648 +0x82a

  testing.runTests.func1()

      GOROOT/src/testing/testing.go:2054 +0x84

  testing.tRunner()

      GOROOT/src/testing/testing.go:1595 +0x238

  testing.runTests()

      GOROOT/src/testing/testing.go:2052 +0x896

  testing.(*M).Run()

      GOROOT/src/testing/testing.go:1925 +0xb57

  main.main()

      bazel-out/k8-fastbuild/bin/pkg/disttask/importinto/importinto_test_/testmain.go:165 +0x78e


Goroutine 58088 (running) created at:

  github.com/pingcap/tidb/pkg/resourcemanager/pool/spool.(*Pool).run()

      pkg/resourcemanager/pool/spool/spool.go:137 +0xf0

  github.com/pingcap/tidb/pkg/resourcemanager/pool/spool.(*Pool).Run()

      pkg/resourcemanager/pool/spool/spool.go:117 +0x179

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*Manager).startDispatcher()

      pkg/disttask/framework/dispatcher/dispatcher_manager.go:269 +0xfe

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*Manager).dispatchTaskLoop()

      pkg/disttask/framework/dispatcher/dispatcher_manager.go:212 +0x12c6

  github.com/pingcap/tidb/pkg/disttask/framework/dispatcher.(*Manager).dispatchTaskLoop-fm()

      <autogenerated>:1 +0x33

  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()

      pkg/util/wait_group_wrapper.go:154 +0x84

==================

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Oct 24, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 labels Oct 25, 2023
@seiya-annie seiya-annie removed may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 labels Oct 25, 2023
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label May 10, 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. component/test severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants