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

rate limit: fix initialize defaults #10536

Merged
merged 8 commits into from
Dec 14, 2020
Merged

Conversation

alexanderbez
Copy link
Contributor

When coming from 1.5.x to 1.6.x, rate limit resource quotas are incompletely initialized. In partciular, the underling rate limiter was swapped between these two versions and the current one (1.6.x) requires fields that when coming from 1.5.x, do not exist. Given these fields are never mutated or provided by an operator or client, the solution is to just set them to the default(s).

@alexanderbez
Copy link
Contributor Author

Note @vishalnayak, I do not think you can get this to panic unless you go from 1.6.x -> 1.5.x -> 1.6.x. This is because block_interval needs to be defined in order to trigger the panic and that only happens in 1.6.x.

@mladlow mladlow added this to the 1.6.1 milestone Dec 14, 2020
@vishalnayak
Copy link
Member

@vishalnayak
Copy link
Member

Note that we didn't have to restart Vault to see the panic. If we just updated a rate limit quota that existed in 1.5.5, that was enough to trigger it. This is because, even the update operation will walk over the initialize function.

@vishalnayak
Copy link
Member

@alexanderbez You might want to add changelog file to this PR.

@alexanderbez
Copy link
Contributor Author

Added a CL entry @vishalnayak

Copy link
Contributor

@mladlow mladlow left a comment

Choose a reason for hiding this comment

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

This should have a changelog file, not a direct edit to changelog.md

Copy link
Contributor

@mladlow mladlow left a comment

Choose a reason for hiding this comment

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

Approving - my approval only covers the changelog though

@alexanderbez alexanderbez merged commit 605cdd3 into master Dec 14, 2020
@alexanderbez alexanderbez deleted the core/rate-limit-upgrade-fix branch December 14, 2020 20:03
@alexanderbez
Copy link
Contributor Author

alexanderbez commented Dec 14, 2020

Backport PR for 1.6.x: #10565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants