-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Add ability to set default vhost limits by pattern #6172
Conversation
Right, I see I failed to follow the breadcrumbs deep enough. Let me fix the snippets. |
This time it feels like flaky tests. |
@rin and I have noticed a genuine failure on this branch: bazel test --config=local //deps/rabbitmq_management:rabbit_mgmt_rabbitmqadmin_SUITE fails with
so the HTTP API response must have changed but the test hasn't. |
There is also a CLI suite test failure: bazel test --config=local //deps/rabbitmq_cli:all
|
Limits are defined in the instance config: default_limits.vhosts.1.pattern = ^device default_limits.vhosts.1.max_connections = 10 default_limits.vhosts.1.max_queues = 10 default_limits.vhosts.2.pattern = ^system default_limits.vhosts.2.max_connections = 100 default_limits.vhosts.3.pattern = .* default_limits.vhosts.3.max_connections = 20 default_limits.vhosts.3.max_queues = 20 Where pattern is a regular expression used to match limits to a newly created vhost, and the limits are non-negative integers. First matching set of limits is applied, only once, during vhost creation.
228727d
to
27ebc04
Compare
Addressed comments, squashed & rebased. |
The example in the commit uses I will rename "vhosts" to be plural because this is a collection. |
I have also noticed that if there are multiple patterns that match, the effective one is picked undeterministically. I suspect that it depends on collection iteration ordering. There are |
I could sort them, e.g. by the pattern hash, if you think it's worth it. I feel the config file mismatch (between instances) makes this a minor issue by comparison. |
I had two extra questions in the description: most importantly, I was able to boot with config values that violate cuttlefish validators. Should I file a separate issue? |
If you can reproduce this outside of RabbitMQ, then sure. Cuttlefish is at Kyorai/cuttlefish. |
Proposed Changes
A fairly straightforward implementation of #4999. Per ticket, vhost limit defaults can be set up with regex patterns in config, and the first matching is applied during vhost creation. Defaults come from a file and are not synced between cluster members.
Unlike the ticket, I do not allow negative limits in favor of omission.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
This change is not documented, nor added to release-notes. LMK if this needs to be addressed.
Before I'm happy with it, several concerns and questions: