-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29663 TimeBasedLimiters should support dynamic configuration refresh #7387
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
Conversation
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.
Pull Request Overview
This PR enables dynamic configuration refresh for TimeBasedLimiters used in HBase quota management. Currently, any changes to quota limiter configurations require a rolling restart to take effect, which is operationally disruptive.
- Modified TimeBasedLimiter and related quota classes to accept Configuration parameters for dynamic rate limiter selection
- Updated quota fetching methods to pass Configuration objects through the call chain
- Removed static Configuration instance from TimeBasedLimiter to enable configuration-aware rate limiter creation
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
TimeBasedLimiter.java | Removed static configuration and modified constructor/factory method to accept Configuration parameter |
QuotaLimiterFactory.java | Updated factory method to accept Configuration parameter |
QuotaState.java | Modified setQuotas method to pass Configuration to quota limiter factory |
UserQuotaState.java | Updated setQuotas methods to accept and pass Configuration parameter |
QuotaUtil.java | Modified quota fetching methods to accept Configuration and pass it through quota creation |
QuotaCache.java | Updated to pass Configuration from services to quota fetching methods |
TestQuotaState.java | Added Configuration parameter to test methods |
TestQuotaCache2.java | Added Configuration parameter to test methods |
TestDefaultOperationQuota.java | Added Configuration parameter to test methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d8837f9
to
02da73e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
02da73e
to
9305086
Compare
public static Map<String, UserQuotaState> fetchUserQuotas(final Connection connection, | ||
Map<TableName, Double> tableMachineQuotaFactors, double factor) throws IOException { | ||
public static Map<String, UserQuotaState> fetchUserQuotas(final Configuration conf, | ||
final Connection connection, Map<TableName, Double> tableMachineQuotaFactors, double factor) |
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.
Can you retrieve the Configuration instance from the Connection instance? Or do you expect that something is passing a conf object that they've modified?
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.
I'm not sure whether it's guaranteed that the connection passed here will always have a dynamically refreshed configuration. Feel like the intention is more clear with this as an explicit arg, but I agree the redundant arg is a little painful...
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9305086
to
91e0011
Compare
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Test failures are now unrelated:
|
…fresh (#7387) Co-authored-by: Ray Mattingly <rmattingly@hubspot.com> Signed-off-by: Charles Connell <cconnell@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
…fresh (#7387) Co-authored-by: Ray Mattingly <rmattingly@hubspot.com> Signed-off-by: Charles Connell <cconnell@apache.org> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Right now any modifications to Quotas' underlying TimeBasedLimiters' configurations require a rolling restart to take effect. In an ideal world, it would be easier to make / rollback changes to something so impactful.
As part of https://issues.apache.org/jira/browse/HBASE-29351, I've been working on a smart rate limiter at my day job, and I'd like to contribute it to the open-source project. It will be much easier to work with a more sophisticated rate limiter that can be reconfigured more trivially