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

storelimit: getOrCreateStoreLimit will meet datarace #8253

Closed
lhy1024 opened this issue Jun 5, 2024 · 1 comment · Fixed by #8254
Closed

storelimit: getOrCreateStoreLimit will meet datarace #8253

lhy1024 opened this issue Jun 5, 2024 · 1 comment · Fixed by #8254
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/minor type/bug The issue is confirmed as a bug.

Comments

@lhy1024
Copy link
Contributor

lhy1024 commented Jun 5, 2024

Bug Report

What did you do?

getOrCreateStoreLimit from different source

What did you expect to see?

no datarace

What did you see instead?

Write at 0x00c00070d928 by goroutine 270:
  github.com/tikv/pd/pkg/core/storelimit.(*limit).Reset()
      /home/lhy1024/pd/pkg/core/storelimit/store_limit.go:152 +0x265
  github.com/tikv/pd/pkg/core/storelimit.(*StoreRateLimit).Reset()
      /home/lhy1024/pd/pkg/core/storelimit/store_limit.go:126 +0x3b
  github.com/tikv/pd/pkg/core.(*StoresInfo).ResetStoreLimit.ResetStoreLimit.func1()
      /home/lhy1024/pd/pkg/core/store_option.go:258 +0x14b
  github.com/tikv/pd/pkg/core.(*StoreInfo).Clone()
      /home/lhy1024/pd/pkg/core/store.go:112 +0x17a
  github.com/tikv/pd/pkg/core.(*StoresInfo).ResetStoreLimit()
      /home/lhy1024/pd/pkg/core/store.go:870 +0x208
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).getOrCreateStoreLimit()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:989 +0x2b7
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).ack()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:576 +0x217
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).removeOperatorInner()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:650 +0x224
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).addOperatorInner()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:519 +0x35d
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).PromoteWaitingOperator()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:413 +0x356
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).AddWaitingOperator()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:345 +0xc3a
  github.com/tikv/pd/pkg/schedule.(*Coordinator).tryAddOperators()
      /home/lhy1024/pd/pkg/schedule/coordinator.go:444 +0x247
  github.com/tikv/pd/pkg/schedule.(*PatrolRegionContext).startPatrolRegionWorkers.func1()
      /home/lhy1024/pd/pkg/schedule/coordinator.go:216 +0x209

Previous read at 0x00c00070d928 by goroutine 272:
  github.com/tikv/pd/pkg/core/storelimit.(*StoreRateLimit).Rate()
      /home/lhy1024/pd/pkg/core/storelimit/store_limit.go:109 +0x217
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).getOrCreateStoreLimit()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:988 +0x111
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).ack()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:576 +0x217
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).removeOperatorInner()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:650 +0x224
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).addOperatorInner()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:519 +0x35d
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).PromoteWaitingOperator()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:413 +0x356
  github.com/tikv/pd/pkg/schedule/operator.(*Controller).AddWaitingOperator()
      /home/lhy1024/pd/pkg/schedule/operator/operator_controller.go:345 +0xc3a
  github.com/tikv/pd/pkg/schedule.(*Coordinator).tryAddOperators()
      /home/lhy1024/pd/pkg/schedule/coordinator.go:444 +0x247
  github.com/tikv/pd/pkg/schedule.(*PatrolRegionContext).startPatrolRegionWorkers.func1()
      /home/lhy1024/pd/pkg/schedule/coordinator.go:216 +0x209

What version of PD are you using (pd-server -V)?

@lhy1024 lhy1024 added the type/bug The issue is confirmed as a bug. label Jun 5, 2024
@lhy1024 lhy1024 added severity/minor affects-8.1 This bug affects the 8.1.x(LTS) versions. labels Jun 5, 2024
@lhy1024
Copy link
Contributor Author

lhy1024 commented Jun 5, 2024

It only affects 8.1 and not 7.5

@ti-chi-bot ti-chi-bot bot closed this as completed in #8254 Jun 5, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jun 5, 2024
close #8253

Signed-off-by: lhy1024 <admin@liudos.us>
ti-chi-bot bot pushed a commit that referenced this issue Jun 6, 2024
close #8253

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: lhy1024 <admin@liudos.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/minor type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

1 participant