Skip to content

HBASE-29281 Atomic request throttles are missing QuotaSettingsFactory support - #6953

Merged
rmdmattingly merged 1 commit into
apache:masterfrom
HubSpot:HBASE-29281
May 1, 2025
Merged

HBASE-29281 Atomic request throttles are missing QuotaSettingsFactory support#6953
rmdmattingly merged 1 commit into
apache:masterfrom
HubSpot:HBASE-29281

Conversation

@rmdmattingly

Copy link
Copy Markdown
Contributor

While rolling out atomic throttles at my day job, I realized that we're unable to fetch our atomic throttle settings. This is because, in https://issues.apache.org/jira/browse/HBASE-29229, I forgot to wire up atomic throttles in the QuotaSettingsFactory.

I've also added a test that will make it much harder to make this same mistake down the road

Comment on lines +661 to +663
for (ThrottleType throttleType : ThrottleType.values()) {
canSetAndGetUserThrottle(throttleType);
}

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

By validating this for every throttle type, we'll prevent new throttle types from missing this key usability piece down the road

CopilotAI left a comment

Copy link
Copy Markdown

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 addresses the missing support for atomic throttle settings in the QuotaSettingsFactory and adds tests to validate that all throttle types—including the new atomic ones—are handled correctly.

  • Updated QuotaSettingsFactory.java to process atomic read size, write size, and request number throttles.
  • Added a new test method in TestQuotaThrottle.java to iterate over all throttle types and verify that the quota settings are applied and subsequently removed.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.javaAdded tests to verify correct setting and removal of all throttle types.
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaSettingsFactory.javaExtended throttle settings construction to include atomic throttle support.
Comments suppressed due to low confidence (1)

hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java:690

  • Consider asserting that the quota for the given throttleType has been successfully removed after unthrottling, to enhance test coverage and validate the unthrottling behavior.
admin.setQuota(QuotaSettingsFactory.unthrottleUserByThrottleType(userName, throttleType));

Comment on lines 170 to +178
}
if (throttle.hasAtomicReadSize()) {
settings.add(ThrottleSettings.fromTimedQuota(userName, tableName, namespace, regionServer,
ThrottleType.ATOMIC_READ_SIZE, throttle.getAtomicReadSize()));
}
if (throttle.hasAtomicWriteSize()) {
settings.add(ThrottleSettings.fromTimedQuota(userName, tableName, namespace, regionServer,
ThrottleType.ATOMIC_WRITE_SIZE, throttle.getAtomicWriteSize()));
}

CopilotAIApr 30, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Consider adding an inline comment here (and similarly for atomic write and request numbers) to explain the purpose of handling these atomic throttle settings for improved maintainability.

Suggested change
}
if (throttle.hasAtomicReadSize()) {
settings.add(ThrottleSettings.fromTimedQuota(userName, tableName, namespace, regionServer,
ThrottleType.ATOMIC_READ_SIZE, throttle.getAtomicReadSize()));
}
if (throttle.hasAtomicWriteSize()) {
settings.add(ThrottleSettings.fromTimedQuota(userName, tableName, namespace, regionServer,
ThrottleType.ATOMIC_WRITE_SIZE, throttle.getAtomicWriteSize()));
}
}
// Handle atomic read size throttling: This enforces limits on the size of read operations
// at an atomic level, ensuring precise control over resource usage.
if (throttle.hasAtomicReadSize()) {
settings.add(ThrottleSettings.fromTimedQuota(userName, tableName, namespace, regionServer,
ThrottleType.ATOMIC_READ_SIZE, throttle.getAtomicReadSize()));
}
// Handle atomic write size throttling: This enforces limits on the size of write operations
// at an atomic level, ensuring precise control over resource usage.
if (throttle.hasAtomicWriteSize()) {
settings.add(ThrottleSettings.fromTimedQuota(userName, tableName, namespace, regionServer,
ThrottleType.ATOMIC_WRITE_SIZE, throttle.getAtomicWriteSize()));
}
// Handle atomic request number throttling: This enforces limits on the number of requests
// at an atomic level, ensuring precise control over resource usage.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I'm against superfluous comments that just reiterate straightforward code. This is already too verbose

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 35sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for branch
+1 💚mvninstall6m 37smaster passed
+1 💚compile7m 15smaster passed
+1 💚checkstyle1m 56smaster passed
+1 💚spotbugs4m 52smaster passed
+1 💚spotless1m 35sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 22sMaven dependency ordering for patch
+1 💚mvninstall6m 29sthe patch passed
+1 💚compile6m 53sthe patch passed
+1 💚javac6m 53sthe patch passed
+1 💚blanks0m 1sThe patch has no blanks issues.
+1 💚checkstyle1m 56sthe patch passed
+1 💚spotbugs5m 23sthe patch passed
+1 💚hadoopcheck20m 36sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless1m 40spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 50sThe patch does not generate ASF License warnings.
80m 20s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6953/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6953
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 98c72d26f586 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ec1aa84
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count84 (vs. ulimit of 30000)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6953/1/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 52sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for branch
+1 💚mvninstall4m 43smaster passed
+1 💚compile2m 2smaster passed
+1 💚javadoc1m 8smaster passed
+1 💚shadedjars7m 58sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall4m 22sthe patch passed
+1 💚compile1m 45sthe patch passed
+1 💚javac1m 45sthe patch passed
+1 💚javadoc1m 2sthe patch passed
+1 💚shadedjars7m 58spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit2m 1shbase-client in the patch passed.
+1 💚unit221m 53shbase-server in the patch passed.
260m 53s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6953/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6953
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 1ee895875e17 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ec1aa84
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6953/1/testReport/
Max. process+thread count5960 (vs. ulimit of 30000)
modulesC: hbase-client hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6953/1/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@rmdmattingly
rmdmattingly merged commit 9e19120 into apache:masterMay 1, 2025
@rmdmattingly
rmdmattingly deleted the HBASE-29281 branch May 1, 2025 12:03
rmdmattingly added a commit that referenced this pull request May 1, 2025
… support (#6953)
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit that referenced this pull request May 1, 2025
… support (#6953)
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit that referenced this pull request May 1, 2025
… support (#6953)
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit that referenced this pull request May 2, 2025
… support (#6953) (#6956)
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
rmdmattingly added a commit that referenced this pull request May 2, 2025
… support (#6953) (#6957)
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
rmdmattingly added a commit that referenced this pull request May 2, 2025
… support (#6953) (#6958)
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
… support (apache#6953) (apache#6957)
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Sign up for freeto 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.

4 participants

@rmdmattingly@Apache-HBase@ndimiduk