tikv / tikv/pd

Clarifying resource group token distribution behavior

Open
#9,775 3 comments 0 reactions 0 assignees View on GitHub
component/resource-control contribution first-time-contributor needs-type
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

I'm currently in the process of root causing why our TiDB host fleet sees RG exceeded errors for resource groups with < 50% avg utilization / < 75% max utilization. I'm looking to clarify [this](https://github.com/tikv/pd/blob/640fbed566acac2e26db2b832b68c8d41a35d1e1/client/resource_group/controller/controller.go#L1257) part of the token allocation logic:

```
// Otherwise the granted token is delivered to the client by fill rate.
cfg.NewTokens = 0
trickleDuration := time.Duration(trickleTimeMs) * time.Millisecond
deadline := gc.run.now.Add(trickleDuration)
cfg.NewRate = float64(bucket.GetSettings().FillRate) + granted/trickleDuration.Seconds()
```

AFAICT, we should set NewTokens to the granted value here as well, instead of updating the FillRate. Can someone confirm the code really reflects the intended behavior?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.