[
https://issues.apache.org/jira/browse/KAFKA-9658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17052400#comment-17052400
]
ASF GitHub Bot commented on KAFKA-9658:
---------------------------------------
apovzner commented on pull request #8232: KAFKA-9658: Fix removing user quotas
URL: https://github.com/apache/kafka/pull/8232
Adding (add-config) default user, user, or <user, client-id> quota and then
removing it via delete-config does not update quota bound in
ClientQuotaManager.Metrics for existing users or <user,client-id>. This causes
brokers to continue to throttle with the previously set quotas until brokers
restart (or <user,client> stops sending traffic for sometime and sensor
expires). This happens only when removing the user or user,client-id where
there are no more quotas to fall back to. Common example where the issue
happens: Initial no quota state --> add default user quota --> remove default
user quota.
The cause of the issue was `DefaultQuotaCallback.quotaLimit` was returning
`null` when no default user quota set, which caused
ClientQuotaManager.updateQuotaMetricConfigs` to skip updating the appropriate
sensor, which left it unchanged with the previous quota. This PR changes
`DefaultQuotaCallback.quotaLimit` to return unlimited (Max long) quota in this
case.
Added 3 unit tests that failed before the fix in the PR.
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Removing default user quota doesn't take effect until broker restart
> --------------------------------------------------------------------
>
> Key: KAFKA-9658
> URL: https://issues.apache.org/jira/browse/KAFKA-9658
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 2.0.1, 2.1.1, 2.2.2, 2.4.0, 2.3.1
> Reporter: Anna Povzner
> Assignee: Anna Povzner
> Priority: Major
>
> To reproduce (for any quota type: produce, consume, and request):
> Example with consumer quota, assuming no user/client quotas are set initially.
> 1. Set default user consumer quotas:
> {{./kafka-configs.sh --zookeeper <ZK> --alter --add-config
> 'consumer_byte_rate=100000000' --entity-type users --entity-default}}
> {{2. Send some consume load for some user, say user1.}}
> {{3. Remove default user consumer quota using:}}
> {{./kafka-configs.sh --zookeeper <ZK> --alter --delete-config
> 'consumer_byte_rate' --entity-type users --entity-default}}
> Result: --describe (as below) returns correct result that there is no quota,
> but quota bound in ClientQuotaManager.metrics does not get updated for users
> that were sending load, which causes the broker to continue throttling
> requests with the previously set quota.
> {{/opt/confluent/bin/kafka-configs.sh --zookeeper <ZK> --describe
> --entity-type users --entity-default}}
> {{}}{{}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)