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 TestExternalEngine #46783

Closed
Tracked by #41316
lance6716 opened this issue Sep 8, 2023 · 0 comments · Fixed by #46782
Closed
Tracked by #41316

data race in TestExternalEngine #46783

lance6716 opened this issue Sep 8, 2023 · 0 comments · Fixed by #46782
Labels
severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

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)

https://do.pingcap.net/jenkins/blue/rest/organizations/jenkins/pipelines/pingcap/pipelines/tidb/pipelines/ghpr_unit_test/runs/32449/nodes/59/steps/64/log/?start=0

WARNING: DATA RACE
Read at 0x00c000ac1f50 by goroutine 144:
  slices.insertionSortCmpFunc[go.shape.*uint8]()
      GOROOT/src/slices/zsortanyfunc.go:12 +0xfd
  slices.pdqsortCmpFunc[go.shape.*uint8]()
      GOROOT/src/slices/zsortanyfunc.go:73 +0x6c8
  slices.SortFunc[go.shape.[]*github.com/pingcap/tidb/store/pdtypes.Region,go.shape.*uint8]()
      GOROOT/src/slices/sort.go:28 +0xc6
  github.com/pingcap/tidb/store/pdtypes.(*RegionTree).ScanRange()
      store/pdtypes/region_tree.go:55 +0x7b
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*testSplitClient).ScanRegions()
      br/pkg/lightning/backend/local/localhelper_test.go:257 +0x1cf
  github.com/pingcap/tidb/br/pkg/restore/split.PaginateScanRegion.func1()
      br/pkg/restore/split/split.go:106 +0x1b6
  github.com/pingcap/tidb/br/pkg/utils.WithRetry.func1()
      br/pkg/utils/retry.go:57 +0x41
  github.com/pingcap/tidb/br/pkg/utils.WithRetryV2[go.shape.struct {}]()
      br/pkg/utils/retry.go:75 +0xe1
  github.com/pingcap/tidb/br/pkg/utils.WithRetry()
      br/pkg/utils/retry.go:56 +0x8c
  github.com/pingcap/tidb/br/pkg/restore/split.PaginateScanRegion()
      br/pkg/restore/split/split.go:101 +0x28f
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).generateJobForRange()
      br/pkg/lightning/backend/local/local.go:1264 +0x2ec
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).generateAndSendJob.func1()
      br/pkg/lightning/backend/local/local.go:1196 +0x1f9
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      external/org_golang_x_sync/errgroup/errgroup.go:75 +0x76

Previous write at 0x00c000ac1f50 by goroutine 145:
  slices.insertionSortCmpFunc[go.shape.*uint8]()
      GOROOT/src/slices/zsortanyfunc.go:13 +0x211
  slices.pdqsortCmpFunc[go.shape.*uint8]()
      GOROOT/src/slices/zsortanyfunc.go:73 +0x6c8
  slices.SortFunc[go.shape.[]*github.com/pingcap/tidb/store/pdtypes.Region,go.shape.*uint8]()
      GOROOT/src/slices/sort.go:28 +0xc6
  github.com/pingcap/tidb/store/pdtypes.(*RegionTree).ScanRange()
      store/pdtypes/region_tree.go:55 +0x7b
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*testSplitClient).ScanRegions()
      br/pkg/lightning/backend/local/localhelper_test.go:257 +0x1cf
  github.com/pingcap/tidb/br/pkg/restore/split.PaginateScanRegion.func1()
      br/pkg/restore/split/split.go:106 +0x1b6
  github.com/pingcap/tidb/br/pkg/utils.WithRetry.func1()
      br/pkg/utils/retry.go:57 +0x41
  github.com/pingcap/tidb/br/pkg/utils.WithRetryV2[go.shape.struct {}]()
      br/pkg/utils/retry.go:75 +0xe1
  github.com/pingcap/tidb/br/pkg/utils.WithRetry()
      br/pkg/utils/retry.go:56 +0x8c
  github.com/pingcap/tidb/br/pkg/restore/split.PaginateScanRegion()
      br/pkg/restore/split/split.go:101 +0x28f
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).generateJobForRange()
      br/pkg/lightning/backend/local/local.go:1264 +0x2ec
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).generateAndSendJob.func1()
      br/pkg/lightning/backend/local/local.go:1196 +0x1f9
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      external/org_golang_x_sync/errgroup/errgroup.go:75 +0x76

Goroutine 144 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      external/org_golang_x_sync/errgroup/errgroup.go:72 +0x124
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).generateAndSendJob()
      br/pkg/lightning/backend/local/local.go:1190 +0x4ae
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).prepareAndSendJob()
      br/pkg/lightning/backend/local/local.go:1134 +0xa18
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).doImport()
      br/pkg/lightning/backend/local/local.go:1645 +0x7e6
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).ImportEngine()
      br/pkg/lightning/backend/local/local.go:1531 +0x12fd
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.TestExternalEngine.func3()
      br/pkg/lightning/backend/local/local_test.go:2224 +0x124

Goroutine 145 (finished) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      external/org_golang_x_sync/errgroup/errgroup.go:72 +0x124
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).generateAndSendJob()
      br/pkg/lightning/backend/local/local.go:1190 +0x4ae
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).prepareAndSendJob()
      br/pkg/lightning/backend/local/local.go:1134 +0xa18
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).doImport()
      br/pkg/lightning/backend/local/local.go:1645 +0x7e6
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.(*Backend).ImportEngine()
      br/pkg/lightning/backend/local/local.go:1531 +0x12fd
  github.com/pingcap/tidb/br/pkg/lightning/backend/local.TestExternalEngine.func3()
      br/pkg/lightning/backend/local/local_test.go:2224 +0x124

4. What is your TiDB version? (Required)

@lance6716 lance6716 added type/bug The issue is confirmed as a bug. severity/moderate labels Sep 8, 2023
ti-chi-bot bot pushed a commit that referenced this issue Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant