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

fix(redisquota): use dimensions in quota key to match memquota #16022

Merged

Conversation

douglas-reid
Copy link
Contributor

This PR is meant to address the issues raised in #15543 .

It duplicates the keys.go into the redisquota package (for simplicity) and updates the key definition to use makeKey.

[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ X ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

@istio-testing istio-testing added the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Aug 2, 2019
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Aug 2, 2019
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 2, 2019
@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: douglas-reid

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@douglas-reid douglas-reid marked this pull request as ready for review August 2, 2019 21:08
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Aug 2, 2019
@geeknoid geeknoid removed the approved label Aug 5, 2019
for k2 := range v {
mk = append(mk, k2)
}
sort.Strings(mk)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could also be sorted at init time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup. this file was just a copy/paste job from memquota package to ensure that it was being done the same way.


// ensure stable order
for k := range labels {
keys = append(keys, k)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This could be moved to init time.
Could be done in a follow up.

sort.Strings(mk)

for _, k2 := range mk {
buf.WriteString(k2) // nolint: gas
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't sound right, "a=bc" is same as "ab=c". I know this is the same bug in the original code. Can you at least add a comment where this code is copied from so that we fix both when needed?

Copy link
Contributor

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This preserves memquota behavior with all its quirks, so it's fine as-is.
/lgtm
/approve

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #16106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants