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

*: fix data race on the SetResourceGroupTagger #491

Merged

Conversation

hawkingrei
Copy link
Member

Signed-off-by: Weizhen Wang wangweizhen@pingcap.com

==================
WARNING: DATA RACE
Write at 0x00c001ff5c98 by goroutine 80:
  github.com/tikv/client-go/v2/txnkv/txnsnapshot.(*KVSnapshot).SetResourceGroupTagger()
      /home/prow/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.1-0.20220406091203-f73ec0e675f4/txnkv/txnsnapshot/snapshot.go:756 +0x78a
  github.com/pingcap/tidb/store/driver/txn.(*tikvSnapshot).SetOption()
      /go/tidb/store/driver/txn/snapshot.go:119 +0x73c
  github.com/pingcap/tidb/executor.setOptionForTopSQL()
      /go/tidb/executor/executor.go:2016 +0x67
  github.com/pingcap/tidb/executor.(*PointGetExecutor).Open()
      /go/tidb/executor/point_get.go:197 +0x10eb
  github.com/pingcap/tidb/executor.(*baseExecutor).Open()
      /go/tidb/executor/executor.go:186 +0x2ad
  github.com/pingcap/tidb/executor.(*ProjectionExec).Open()
      /go/tidb/executor/projection.go:86 +0x4b
  github.com/pingcap/tidb/executor.(*UnionExec).resultPuller()
      /go/tidb/executor/executor.go:1660 +0x3d4
  github.com/pingcap/tidb/executor.(*UnionExec).initialize.func1()
      /go/tidb/executor/executor.go:1627 +0x64
Previous write at 0x00c001ff5c98 by goroutine 71:
  github.com/tikv/client-go/v2/txnkv/txnsnapshot.(*KVSnapshot).SetResourceGroupTagger()
      /home/prow/go/pkg/mod/github.com/tikv/client-go/v2@v2.0.1-0.20220406091203-f73ec0e675f4/txnkv/txnsnapshot/snapshot.go:756 +0x78a
  github.com/pingcap/tidb/store/driver/txn.(*tikvSnapshot).SetOption()
      /go/tidb/store/driver/txn/snapshot.go:119 +0x73c
  github.com/pingcap/tidb/executor.setOptionForTopSQL()
      /go/tidb/executor/executor.go:2016 +0x67
  github.com/pingcap/tidb/executor.(*PointGetExecutor).Open()
      /go/tidb/executor/point_get.go:197 +0x10eb
  github.com/pingcap/tidb/executor.(*baseExecutor).Open()
      /go/tidb/executor/executor.go:186 +0x2ad
  github.com/pingcap/tidb/executor.(*ProjectionExec).Open()
      /go/tidb/executor/projection.go:86 +0x4b
  github.com/pingcap/tidb/executor.(*UnionExec).resultPuller()
      /go/tidb/executor/executor.go:1660 +0x3d4
  github.com/pingcap/tidb/executor.(*UnionExec).initialize.func1()
      /go/tidb/executor/executor.go:1627 +0x64
Goroutine 80 (running) created at:
  github.com/pingcap/tidb/executor.(*UnionExec).initialize()
      /go/tidb/executor/executor.go:1627 +0x4d0
  github.com/pingcap/tidb/executor.(*UnionExec).Next()
      /go/tidb/executor/executor.go:1703 +0xc4
  github.com/pingcap/tidb/executor.Next()
      /go/tidb/executor/executor.go:306 +0x5af
  github.com/pingcap/tidb/executor.(*HashAggExec).fetchChildData()
      /go/tidb/executor/aggregate.go:791 +0x319
  github.com/pingcap/tidb/executor.(*HashAggExec).prepare4ParallelExec.func3()
      /go/tidb/executor/aggregate.go:828 +0x64
Goroutine 71 (running) created at:
  github.com/pingcap/tidb/executor.(*UnionExec).initialize()
      /go/tidb/executor/executor.go:1627 +0x4d0
  github.com/pingcap/tidb/executor.(*UnionExec).Next()
      /go/tidb/executor/executor.go:1703 +0xc4
  github.com/pingcap/tidb/executor.Next()
      /go/tidb/executor/executor.go:306 +0x5af
  github.com/pingcap/tidb/executor.(*HashAggExec).fetchChildData()
      /go/tidb/executor/aggregate.go:791 +0x319
  github.com/pingcap/tidb/executor.(*HashAggExec).prepare4ParallelExec.func3()
      /go/tidb/executor/aggregate.go:828 +0x64
================== 

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@sticnarf sticnarf merged commit ff5e35a into tikv:master May 10, 2022
@hawkingrei hawkingrei deleted the fix_data_race_on_SetResourceGroupTagger branch May 10, 2022 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants