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
fix(redisquota): use dimensions in quota key to match memquota #16022
Conversation
[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 |
for k2 := range v { | ||
mk = append(mk, k2) | ||
} | ||
sort.Strings(mk) |
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.
this could also be sorted at init time.
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.
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) |
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.
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 |
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.
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?
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.
This preserves memquota behavior with all its quirks, so it's fine as-is.
/lgtm
/approve
In response to a cherrypick label: new pull request created: #16106 |
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 usemakeKey
.[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ X ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure