Skip to content

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

@hawkingrei

Description

@hawkingrei

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions