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 IndexNestedLoopHashJoin #30582

Closed
hawkingrei opened this issue Dec 9, 2021 · 2 comments · Fixed by #30619
Closed

DATA RACE in the IndexNestedLoopHashJoin #30582

hawkingrei opened this issue Dec 9, 2021 · 2 comments · Fixed by #30619
Assignees
Labels
severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

hawkingrei commented Dec 9, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

make race

  WARNING: DATA RACE
Write at 0x00c0416cf178 by goroutine 543:
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).startWorkers()
      /go/tidb/executor/index_lookup_hash_join.go:177 +0xaf7
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).Open()
      /go/tidb/executor/index_lookup_hash_join.go:157 +0x4c6
  github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
      /go/tidb/executor/adapter.go:387 +0x442
  github.com/pingcap/tidb/session.runStmt()
      /go/tidb/session/session.go:1696 +0x323
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      /go/tidb/session/session.go:1580 +0xcf0
  github.com/pingcap/tidb/util/testkit.(*TestKit).Exec()
      /go/tidb/util/testkit/testkit.go:199 +0x2fc
  github.com/pingcap/tidb/util/testkit.(*TestKit).QueryToErr()
      /go/tidb/util/testkit/testkit.go:375 +0x219
  github.com/pingcap/tidb/executor_test.(*testSuiteJoinSerial).TestIssue30211.func1()
      /go/tidb/executor/join_test.go:2662 +0x29c
  github.com/pingcap/tidb/executor_test.(*testSuiteJoinSerial).TestIssue30211()
      /go/tidb/executor/join_test.go:2664 +0x1c4
  runtime.call16()
      /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
  reflect.Value.Call()
      /usr/local/go/src/reflect/value.go:337 +0xd8
  github.com/pingcap/check.(*suiteRunner).forkTest.func1()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
  github.com/pingcap/check.(*suiteRunner).forkCall.func1()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d
Previous read at 0x00c0416cf178 by goroutine 239:
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).finishJoinWorkers()
      /go/tidb/executor/index_lookup_hash_join.go:209 +0x474
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).finishJoinWorkers-fm()
      /go/tidb/executor/index_lookup_hash_join.go:204 +0x5e
  github.com/pingcap/tidb/util.WithRecovery.func1()
      /go/tidb/util/misc.go:92 +0x392
  runtime.call16()
      /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
  github.com/pingcap/failpoint.(*term).do()
      /home/prow/go/pkg/mod/github.com/pingcap/failpoint@v0.0.0-20210316064728-7acb0f0a3dfd/terms.go:310 +0x193
  github.com/pingcap/failpoint.(*terms).eval()
      /home/prow/go/pkg/mod/github.com/pingcap/failpoint@v0.0.0-20210316064728-7acb0f0a3dfd/terms.go:115 +0x194
  github.com/pingcap/failpoint.(*Failpoint).Eval()
      /home/prow/go/pkg/mod/github.com/pingcap/failpoint@v0.0.0-20210316064728-7acb0f0a3dfd/failpoint.go:109 +0xfa
  github.com/pingcap/failpoint.(*Failpoints).Eval()
      /home/prow/go/pkg/mod/github.com/pingcap/failpoint@v0.0.0-20210316064728-7acb0f0a3dfd/failpoints.go:212 +0x104
  github.com/pingcap/failpoint.Eval()
      /home/prow/go/pkg/mod/github.com/pingcap/failpoint@v0.0.0-20210316064728-7acb0f0a3dfd/failpoints.go:273 +0x6e
  github.com/pingcap/tidb/executor.(*indexHashJoinOuterWorker).run()
      /go/tidb/executor/index_lookup_hash_join.go:340 +0x1ac
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).startWorkers.func1()
      /go/tidb/executor/index_lookup_hash_join.go:174 +0x53
  github.com/pingcap/tidb/util.WithRecovery()
      /go/tidb/util/misc.go:100 +0x68
Goroutine 543 (running) created at:
  github.com/pingcap/check.(*suiteRunner).forkCall()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:734 +0x4cc
  github.com/pingcap/check.(*suiteRunner).forkTest()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:832 +0x1c4
  github.com/pingcap/check.(*suiteRunner).doRun()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:666 +0x144
  github.com/pingcap/check.(*suiteRunner).run()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:696 +0x144
  github.com/pingcap/check.Run()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/run.go:150 +0x5a
  github.com/pingcap/check.RunAll()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/run.go:136 +0x968
  github.com/pingcap/check.TestingT()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/run.go:99 +0x756
  github.com/pingcap/tidb/executor_test.TestT()
      /go/tidb/executor/executor_test.go:98 +0x84
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1193 +0x202
Goroutine 239 (running) created at:
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).startWorkers()
      /go/tidb/executor/index_lookup_hash_join.go:174 +0x376
  github.com/pingcap/tidb/executor.(*IndexNestedLoopHashJoin).Open()
      /go/tidb/executor/index_lookup_hash_join.go:157 +0x4c6
  github.com/pingcap/tidb/executor.(*ExecStmt).Exec()
      /go/tidb/executor/adapter.go:387 +0x442
  github.com/pingcap/tidb/session.runStmt()
      /go/tidb/session/session.go:1696 +0x323
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      /go/tidb/session/session.go:1580 +0xcf0
  github.com/pingcap/tidb/util/testkit.(*TestKit).Exec()
      /go/tidb/util/testkit/testkit.go:199 +0x2fc
  github.com/pingcap/tidb/util/testkit.(*TestKit).QueryToErr()
      /go/tidb/util/testkit/testkit.go:375 +0x219
  github.com/pingcap/tidb/executor_test.(*testSuiteJoinSerial).TestIssue30211.func1()
      /go/tidb/executor/join_test.go:2662 +0x29c
  github.com/pingcap/tidb/executor_test.(*testSuiteJoinSerial).TestIssue30211()
      /go/tidb/executor/join_test.go:2664 +0x1c4
  runtime.call16()
      /usr/local/go/src/runtime/asm_amd64.s:550 +0x3d
  reflect.Value.Call()
      /usr/local/go/src/reflect/value.go:337 +0xd8
  github.com/pingcap/check.(*suiteRunner).forkTest.func1()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850 +0xb3b
  github.com/pingcap/check.(*suiteRunner).forkCall.func1()
      /home/prow/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739 +0x11d 

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@XuHuaiyu
Copy link
Contributor

duplicate with #27208

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major 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