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

KAFKA-4055: System tests for secure quotas #1860

Closed
wants to merge 1 commit into from

Conversation

rajinisivaram
Copy link
Contributor

Fix existing client-id quota test which currently don't configure quota overrides correctly. Add new tests for user and (user, client-id) quota overrides and default quotas.

@rajinisivaram
Copy link
Contributor Author

The implementation for this feature is in KAFKA-3492 (not yet committed).

self.producer_quota = 3750000
self.consumer_quota = 3000000
self.configure_quota(kafka, self.producer_quota, self.consumer_quota, ['clients', self.client_id])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['clients', None])
Copy link
Contributor

Choose a reason for hiding this comment

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

Is None used to set the default quota? If so, should we handle that specially in configure_quota?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@junrao Yes, None is used to set default quota. configure_quota uses the method entity_name_opt to set the option for quota entity name. That uses --entity-default to set default quota to handle None.

self.consumer_quota = 3000000
self.configure_quota(kafka, self.producer_quota, self.consumer_quota, ['users', QuotaConfig.USER_PRINCIPAL])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['users', None])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['clients', self.client_id])
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this since users always takes precedence?

self.producer_quota = 2500000
self.consumer_quota = 2000000
self.configure_quota(kafka, self.producer_quota, self.consumer_quota, ['users', None])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['clients', None])
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this since users always takes precedence?

self.configure_quota(kafka, self.producer_quota, self.consumer_quota, ['users', QuotaConfig.USER_PRINCIPAL, 'clients', self.client_id])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['users', QuotaConfig.USER_PRINCIPAL, 'clients', None])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['users', None])
self.configure_quota(kafka, QuotaConfig.LARGE_QUOTA, QuotaConfig.LARGE_QUOTA, ['clients', self.client_id])
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I am wondering do we need the above 3 lines at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@junrao You are right, the three lines above are not strictly required. They verify that <user, client> quota does indeed have the highest precedence. The lines with lower precedence (which set a high quota) are just there to ensure that precedence is correctly implemented.
I can remove them if the code is confusing since precedence is also tested in unit tests. Let me know what you think.

@junrao
Copy link
Contributor

junrao commented Sep 19, 2016

@rajinisivaram : Thanks for the patch. Were you able to run the system tests with this patch?

@rajinisivaram
Copy link
Contributor Author

@junrao Thank you for the review. Yes, I ran the system tests yesterday and the test results are here: https://jenkins.confluent.io/job/system-test-kafka-branch-builder/550/console. There were 4 unrelated failures. The rest including the quota tests have passed.

@junrao
Copy link
Contributor

junrao commented Sep 26, 2016

@rajinisivaram : Thanks for the patch. LGTM

@asfgit asfgit closed this in c0a62b7 Sep 26, 2016
asfgit pushed a commit that referenced this pull request Sep 26, 2016
Fix existing client-id quota test which currently don't configure quota overrides correctly. Add new tests for user and (user, client-id) quota overrides and default quotas.

Author: Rajini Sivaram <rajinisivaram@googlemail.com>

Reviewers: Jun Rao <junrao@gmail.com>

Closes #1860 from rajinisivaram/KAFKA-4055

(cherry picked from commit c0a62b7)
Signed-off-by: Jun Rao <junrao@gmail.com>
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.

2 participants