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 executor/sortexec.(*topNChunkHeap).init() #53538

Closed
Tracked by #41316
hawkingrei opened this issue May 24, 2024 · 3 comments · Fixed by #53593
Closed
Tracked by #41316

DATA RACE executor/sortexec.(*topNChunkHeap).init() #53538

hawkingrei opened this issue May 24, 2024 · 3 comments · Fixed by #53593
Labels
severity/moderate sig/execution SIG execution 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 0x00c0020caa20 by goroutine 379:
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNChunkHeap).init()
      pkg/executor/sortexec/topn_chunk_heap.go:50 +0x285
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNWorker).fetchChunksAndProcess()
      pkg/executor/sortexec/topn_worker.go:65 +0x28e
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNWorker).run()
      pkg/executor/sortexec/topn_worker.go:112 +0x76
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).executeTopNWhenSpillTriggered.func2()
      pkg/executor/sortexec/topn.go:426 +0x2e
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x86
Previous read at 0x00c0020caa20 by goroutine 384:
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNSpillHelper).spillHeap()
      pkg/executor/sortexec/topn_spill.go:191 +0x84
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNSpillHelper).spill.func2()
      pkg/executor/sortexec/topn_spill.go:172 +0x14a
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNSpillHelper).spill.func5()
      pkg/executor/sortexec/topn_spill.go:176 +0x41
Goroutine 379 (running) created at:
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run()
      pkg/util/wait_group_wrapper.go:155 +0xe4
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).executeTopNWhenSpillTriggered()
      pkg/executor/sortexec/topn.go:425 +0x245
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).executeTopN()
      pkg/executor/sortexec/topn.go:456 +0x1f9
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).fetchChunks.func2()
      pkg/executor/sortexec/topn.go:259 +0x4f
Goroutine 384 (finished) created at:
  github.com/pingcap/tidb/pkg/executor/sortexec.(*topNSpillHelper).spill()
      pkg/executor/sortexec/topn_spill.go:164 +0x30c
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).checkSpillAndExecute()
      pkg/executor/sortexec/topn.go:341 +0x99
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).fetchChunksFromChild()
      pkg/executor/sortexec/topn.go:384 +0x3a9
  github.com/pingcap/tidb/pkg/executor/sortexec.(*TopNExec).executeTopNWhenSpillTriggered.func1()
      pkg/executor/sortexec/topn.go:420 +0x46
  github.com/pingcap/tidb/pkg/util.(*WaitGroupWrapper).Run.func1()
      pkg/util/wait_group_wrapper.go:157 +0x86
================== 

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label May 24, 2024
@xzhangxian1008
Copy link
Contributor

/moderate

@xzhangxian1008
Copy link
Contributor

/severity moderate

@jebter jebter added the sig/execution SIG execution label May 28, 2024
ti-chi-bot bot pushed a commit that referenced this issue May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants