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

DataRace in storelimit #6263

Closed
lhy1024 opened this issue Apr 3, 2023 · 1 comment
Closed

DataRace in storelimit #6263

lhy1024 opened this issue Apr 3, 2023 · 1 comment
Labels
type/ci The issue is related to CI.

Comments

@lhy1024
Copy link
Contributor

lhy1024 commented Apr 3, 2023

Flaky Test

Which jobs are failing

--- FAIL: TestPreparingProgress (8.47s)
testing.go:1446: race detected during execution of test

==================
WARNING: DATA RACE
Write at 0x00c00535acd8 by goroutine 158195:
  github.com/tikv/pd/pkg/core/storelimit.(*limit).Reset()
      /home/runner/work/pd/pd/pkg/core/storelimit/store_limit.go:133 +0x3f5
  github.com/tikv/pd/pkg/core/storelimit.(*StoreRateLimit).Reset()
      /home/runner/work/pd/pd/pkg/core/storelimit/store_limit.go:107 +0x8a
  github.com/tikv/pd/pkg/schedule.(*OperatorController).getOrCreateStoreLimit()
      /home/runner/work/pd/pd/pkg/schedule/operator_controller.go:870 +0x26c
  github.com/tikv/pd/pkg/schedule.(*OperatorController).exceedStoreLimitLocked()
      /home/runner/work/pd/pd/pkg/schedule/operator_controller.go:847 +0x69b
  github.com/tikv/pd/pkg/schedule.(*OperatorController).PromoteWaitingOperator()
      /home/runner/work/pd/pd/pkg/schedule/operator_controller.go:355 +0x510
  github.com/tikv/pd/pkg/schedule.(*OperatorController).AddWaitingOperator()
      /home/runner/work/pd/pd/pkg/schedule/operator_controller.go:314 +0x10d1
  github.com/tikv/pd/server/cluster.(*coordinator).runScheduler()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:809 +0x56d
  github.com/tikv/pd/server/cluster.(*coordinator).addScheduler.func2()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:639 +0x47

Previous read at 0x00c00535acd8 by goroutine 158359:
  github.com/tikv/pd/pkg/core/storelimit.(*limit).Available()
      /home/runner/work/pd/pd/pkg/core/storelimit/store_limit.go:139 +0x148
  github.com/tikv/pd/pkg/core/storelimit.(*StoreRateLimit).Available()
      /home/runner/work/pd/pd/pkg/core/storelimit/store_limit.go:90 +0x8a
  github.com/tikv/pd/pkg/core.(*StoreInfo).IsAvailable()
      /home/runner/work/pd/pd/pkg/core/store.go:143 +0x248
  github.com/tikv/pd/pkg/schedule/filter.(*StoreStateFilter).exceedRemoveLimit()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:427 +0xc4
  github.com/tikv/pd/pkg/schedule/filter.(*StoreStateFilter).exceedRemoveLimit-fm()
      <autogenerated>:1 +0x57
  github.com/tikv/pd/pkg/schedule/filter.(*StoreStateFilter).anyConditionMatch()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:521 +0xae6
  github.com/tikv/pd/pkg/schedule/filter.(*StoreStateFilter).Source()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:537 +0x199
  github.com/tikv/pd/pkg/schedule/filter.SelectSourceStores.func1.1()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:38 +0x10b
  github.com/tikv/pd/pkg/slice.AllOf[...].func1()
      /home/runner/work/pd/pd/pkg/slice/slice.go:35 +0x4b
  github.com/tikv/pd/pkg/slice.AnyOf[...]()
      /home/runner/work/pd/pd/pkg/slice/slice.go:20 +0xc1
  github.com/tikv/pd/pkg/slice.NoneOf[...]()
      /home/runner/work/pd/pd/pkg/slice/slice.go:29 +0xb8
  github.com/tikv/pd/pkg/slice.AllOf[...]()
      /home/runner/work/pd/pd/pkg/slice/slice.go:37 +0xf8
  github.com/tikv/pd/pkg/schedule/filter.SelectSourceStores.func1()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:37 +0x133
  github.com/tikv/pd/pkg/schedule/filter.filterStoresBy()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:123 +0x216
  github.com/tikv/pd/pkg/schedule/filter.SelectSourceStores()
      /home/runner/work/pd/pd/pkg/schedule/filter/filters.go:36 +0xb9
  github.com/tikv/pd/pkg/schedule/schedulers.(*balanceWitnessScheduler).Schedule()
      /home/runner/work/pd/pd/pkg/schedule/schedulers/balance_witness.go:241 +0xa89
  github.com/tikv/pd/server/cluster.(*scheduleController).Schedule()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:899 +0x31d
  github.com/tikv/pd/server/cluster.(*coordinator).runScheduler()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:808 +0x50a
  github.com/tikv/pd/server/cluster.(*coordinator).addScheduler.func2()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:639 +0x47

Goroutine 158195 (running) created at:
  github.com/tikv/pd/server/cluster.(*coordinator).addScheduler()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:639 +0x3b5
  github.com/tikv/pd/server/cluster.(*coordinator).run()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:403 +0x2e7d
  github.com/tikv/pd/server/cluster.(*coordinator).runUntilStop()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:306 +0x75
  github.com/tikv/pd/server/cluster.(*RaftCluster).runCoordinator()
      /home/runner/work/pd/pd/server/cluster/cluster.go:574 +0x11b
  github.com/tikv/pd/server/cluster.(*RaftCluster).Start.func2()
      /home/runner/work/pd/pd/server/cluster/cluster.go:293 +0x39

Goroutine 158359 (running) created at:
  github.com/tikv/pd/server/cluster.(*coordinator).addScheduler()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:639 +0x3b5
  github.com/tikv/pd/server/cluster.(*coordinator).run()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:403 +0x2e7d
  github.com/tikv/pd/server/cluster.(*coordinator).runUntilStop()
      /home/runner/work/pd/pd/server/cluster/coordinator.go:306 +0x75
  github.com/tikv/pd/server/cluster.(*RaftCluster).runCoordinator()
      /home/runner/work/pd/pd/server/cluster/cluster.go:574 +0x11b
  github.com/tikv/pd/server/cluster.(*RaftCluster).Start.func2()
      /home/runner/work/pd/pd/server/cluster/cluster.go:293 +0x39
==================

CI link

https://github.com/tikv/pd/actions/runs/4594785908/jobs/8114252559?pr=6258

Reason for failure (if possible)

Anything else

@lhy1024 lhy1024 added the type/ci The issue is related to CI. label Apr 3, 2023
@lhy1024
Copy link
Contributor Author

lhy1024 commented Apr 3, 2023

it is the same with #6230

@lhy1024 lhy1024 closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/ci The issue is related to CI.
Projects
None yet
Development

No branches or pull requests

1 participant