-
Notifications
You must be signed in to change notification settings - Fork 725
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
resource_manager: unify RRU and WRU into RU for token limit #5888
Conversation
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/test ? |
@wuhuizuo: The following commands are available to trigger required jobs:
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Codecov ReportBase: 75.66% // Head: 75.73% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5888 +/- ##
==========================================
+ Coverage 75.66% 75.73% +0.06%
==========================================
Files 342 342
Lines 34873 34858 -15
==========================================
+ Hits 26387 26398 +11
+ Misses 6230 6213 -17
+ Partials 2256 2247 -9
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@BornChanger: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
client/go.mod
Outdated
@@ -15,3 +15,5 @@ require ( | |||
go.uber.org/zap v1.20.0 | |||
google.golang.org/grpc v1.51.0 | |||
) | |||
|
|||
replace github.com/pingcap/kvproto => github.com/CabinfeverB/kvproto v0.0.0-20230130100540-c8385fbaf594 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update with new kvproto master
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
requestUnitList map[rmpb.RequestUnitType]struct{} = map[rmpb.RequestUnitType]struct{}{ | ||
rmpb.RequestUnitType_RRU: {}, | ||
rmpb.RequestUnitType_WRU: {}, | ||
requestUnitLimitTypeList map[rmpb.RequestUnitType]struct{} = map[rmpb.RequestUnitType]struct{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this map
now? If not we can remove for range
where it is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the proto keeps RequestUnitType
(though it only has 1 type), I think it's reasonable to keep a list here also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest LGTM.
@@ -74,7 +74,8 @@ func (kc *KVCalculator) BeforeKVRequest(consumption *rmpb.Consumption, req Reque | |||
// Write bytes are knowable in advance, so we can calculate the WRU cost here. | |||
writeBytes := float64(req.WriteBytes()) | |||
consumption.WriteBytes += writeBytes | |||
consumption.WRU += float64(kc.WriteBaseCost) + float64(kc.WriteBytesCost)*writeBytes | |||
wru := float64(kc.WriteBaseCost) + float64(kc.WriteBytesCost)*writeBytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create a new variable?
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> address comment Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
6c48fb2
to
949a73b
Compare
/merge |
@nolouch: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 949a73b
|
close #5885, ref #5887, ref #5888, ref pingcap/tiflow#8110 The global config needs to support both names and configuration paths, not only for compatibility but also to make more sense. Signed-off-by: husharp <jinhao.hu@pingcap.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: Cabinfever_B cabinfeveroier@gmail.com
What problem does this PR solve?
Issue Number: ref #5851
What is changed and how does it work?
If resource group has enough tokens in RU mode, it can consume these tokens for write or read with freedom. So we should provider a unified token limiter for WRU and RRU.
Check List
Tests
Release note