-
Notifications
You must be signed in to change notification settings - Fork 753
feat(resourcemanager): add service limit for keyspace #9354
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
Conversation
|
Skipping CI for Draft Pull Request. |
1236150 to
5543513
Compare
|
@JmPotato: GitHub didn't allow me to request PR reviews from the following users: glorv. Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs. |
5543513 to
96efc42
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9354 +/- ##
==========================================
- Coverage 76.13% 76.09% -0.05%
==========================================
Files 477 478 +1
Lines 74282 74482 +200
==========================================
+ Hits 56557 56674 +117
- Misses 14211 14281 +70
- Partials 3514 3527 +13
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/hold |
96efc42 to
34bdd9b
Compare
|
/unhold |
| oldServiceLimit := krl.ServiceLimit | ||
| krl.ServiceLimit = newServiceLimit | ||
| now := time.Now() | ||
| // If the old service limit was 0 (no limit) or the new service limit is 0, |
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 support forbidding a keyspace via setting the service limit?
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.
Currently, we do not have this requirement. If there is, it should be relatively easy to achieve by using a negative service limit value. Or can we also achieve this by changing the state of the keyspace?
| krl.ServiceLimit*serviceLimiterBurstFactor, | ||
| ) | ||
| // Update the last update time. | ||
| krl.LastUpdate = now |
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.
How about moving it outside and merging it with line 65?
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.
refillTokensLocked is widely used in the unit tests, moving this line out will cause us to manually update LastUpdate in the test.
| c.String(http.StatusBadRequest, err.Error()) | ||
| return | ||
| } | ||
| if req.ServiceLimit < 0 { |
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.
What's the expected behavior if limit is 0, IIRC, the ru_per_sec does not allow 0 value.
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.
Currently, a zero value means no restriction at all, which is equivalent to the absence of a Service Limit.
34bdd9b to
0665873
Compare
cc931e9 to
c2df450
Compare
Signed-off-by: JmPotato <github@ipotato.me>
Signed-off-by: JmPotato <github@ipotato.me>
Signed-off-by: JmPotato <github@ipotato.me>
6df751f to
0843c7f
Compare
| configEndpoint.DELETE("/group/:name", s.deleteResourceGroup) | ||
| configEndpoint.GET("/controller", s.getControllerConfig) | ||
| configEndpoint.POST("/controller", s.setControllerConfig) | ||
| // Without keyspace name, it will get/set the service limit of the null keyspace. |
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.
Does the null keyspace also have the service limit?
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.
I don't want to make the null keyspace too special within the system; also it's useful for the test's convenience.
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.
+1
rleungx
left a comment
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
Signed-off-by: JmPotato <github@ipotato.me>
d390f9f to
4e8043c
Compare
Signed-off-by: JmPotato <github@ipotato.me>
glorv
left a comment
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
|
@glorv: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn 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-sigs/prow repository. |
| } | ||
| // Update the cache. | ||
| m.keyspaceNameLookup[id] = loadedName | ||
| m.updateKeyspaceNameLookup(id, loadedName) |
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.
Is it possible to change the keyspace name? If keyspace is modified or deleted, do we need to update it?
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.
Currently, once a keyspace is created, its ID and name cannot be changed. Therefore, we don’t need to consider cache misses at this stage.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glorv, lhy1024, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #9296.
What is changed and how does it work?
Check List
Tests
With a resource group rg1 whose RU is 5000 and is non-burstable, set the service limit to 10000 RU > 5000 RU:
Set the service limit to 2500 RU:
rg1 5000 RU + rg2 2500 RU with 2500 RU service limit.
Release note