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

HBASE-28349 Count atomic operations against read quotas #5668

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

rmdmattingly
Copy link
Contributor

Right now atomic operations are just treated as a single write from the quota perspective. Since an atomic operation also encompasses a read, it would make sense to increment readNum and readSize counts appropriately.

cc @bbeaudreault @hgromer @eab148 @bozzkar

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 53s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 4m 21s master passed
+1 💚 compile 3m 7s master passed
+1 💚 checkstyle 0m 40s master passed
+1 💚 spotless 0m 51s branch has no errors when running spotless:check.
+1 💚 spotbugs 1m 49s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 55s the patch passed
+1 💚 compile 3m 4s the patch passed
+1 💚 javac 3m 4s the patch passed
+1 💚 checkstyle 0m 37s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 6m 27s Patch does not cause any errors with Hadoop 3.3.6.
+1 💚 spotless 1m 4s patch has no errors when running spotless:check.
+1 💚 spotbugs 2m 35s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
38m 45s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5668
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux 78d1af56f639 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 275d928
Default Java Eclipse Adoptium-11.0.17+8
Max. process+thread count 79 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/console
versions git=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 25s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 19s master passed
+1 💚 compile 0m 47s master passed
+1 💚 shadedjars 5m 49s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 26s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 57s the patch passed
+1 💚 compile 0m 48s the patch passed
+1 💚 javac 0m 48s the patch passed
+1 💚 shadedjars 5m 46s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 23s the patch passed
_ Other Tests _
+1 💚 unit 227m 46s hbase-server in the patch passed.
252m 41s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #5668
Optional Tests javac javadoc unit shadedjars compile
uname Linux fd664535b853 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 275d928
Default Java Eclipse Adoptium-11.0.17+8
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/testReport/
Max. process+thread count 5490 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 44s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 58s master passed
+1 💚 compile 0m 48s master passed
+1 💚 shadedjars 5m 59s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 29s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 34s the patch passed
+1 💚 compile 0m 53s the patch passed
+1 💚 javac 0m 53s the patch passed
+1 💚 shadedjars 5m 56s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 27s the patch passed
_ Other Tests _
+1 💚 unit 239m 33s hbase-server in the patch passed.
266m 44s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #5668
Optional Tests javac javadoc unit shadedjars compile
uname Linux 0ec3c182a529 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 275d928
Default Java Temurin-1.8.0_352-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/testReport/
Max. process+thread count 4980 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/1/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

* @return the OperationQuota
* @throws RpcThrottlingException if the operation cannot be executed due to quota exceeded.
*/
public OperationQuota checkQuota(final Region region, final OperationQuota.OperationType type)
throws IOException, RpcThrottlingException {
public OperationQuota checkQuota(final Region region, final OperationQuota.OperationType type,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking we should add another OperationType CHECK_AND_MUTATE. We can pass that in here instead of adding an isAtomic boolean. We can also add a util in QuotaUtil to return an OperationType for an Action + hasCondition boolean.

We can then use that same api in the other checkQuota below. Something like:

for (final ClientProtos.Action action : actions) {
  OperationType type = QuotaUtil.getOperationType(action, hasCondition);
  if (type.isRead()) {
    numReads++;
  }
  if (type.isWrite()) {
    numWrites++;
  }
}

The goal with this change is to DRY up the mutation type checking, and also to clarify a bit. Currently we are using the isAtomic boolean name which I'm realizing is not accurate. RowMutations is an example of an atomic operation which is not conditional (thus has no reads).

@@ -2679,7 +2679,8 @@ public MultiResponse multi(final RpcController rpcc, final MultiRequest request)

try {
region = getRegion(regionSpecifier);
quota = getRpcQuotaManager().checkQuota(region, regionAction.getActionList());
quota = getRpcQuotaManager().checkQuota(region, regionAction.getActionList(),
regionAction.getAtomic());
Copy link
Contributor

Choose a reason for hiding this comment

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

per my other comment about RowMutations I think we actually want to change this and the other usage of getAtomic to hasCondition. I'm realizing that getAtomic seems specific to RowMutations, which may or may not be conditional depending of if the RowMutations is called via mutateRow, batch, or checkAndMutate (only the last one is conditional).

With this, we'll need to update your RowMutations test to ensure that it doesnt count against read capacity unless its a checkAndMutate

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 2m 59s master passed
+1 💚 compile 2m 30s master passed
+1 💚 checkstyle 0m 33s master passed
+1 💚 spotless 0m 42s branch has no errors when running spotless:check.
+1 💚 spotbugs 1m 27s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 44s the patch passed
+1 💚 compile 2m 27s the patch passed
+1 💚 javac 2m 27s the patch passed
+1 💚 checkstyle 0m 34s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 5m 4s Patch does not cause any errors with Hadoop 3.3.6.
+1 💚 spotless 0m 40s patch has no errors when running spotless:check.
+1 💚 spotbugs 1m 35s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 10s The patch does not generate ASF License warnings.
28m 2s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5668
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux 19b37956a342 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 275d928
Default Java Eclipse Adoptium-11.0.17+8
Max. process+thread count 77 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/2/console
versions git=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@bbeaudreault bbeaudreault left a comment

Choose a reason for hiding this comment

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

LGTM. I will merge once the pre-commit comes back green

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 23s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 2m 42s master passed
+1 💚 compile 2m 29s master passed
+1 💚 checkstyle 0m 33s master passed
+1 💚 spotless 0m 40s branch has no errors when running spotless:check.
+1 💚 spotbugs 1m 25s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 44s the patch passed
+1 💚 compile 2m 28s the patch passed
+1 💚 javac 2m 28s the patch passed
+1 💚 checkstyle 0m 35s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 5m 2s Patch does not cause any errors with Hadoop 3.3.6.
+1 💚 spotless 0m 39s patch has no errors when running spotless:check.
+1 💚 spotbugs 1m 34s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 8s The patch does not generate ASF License warnings.
27m 45s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5668
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux c9a335704284 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / e85557a
Default Java Eclipse Adoptium-11.0.17+8
Max. process+thread count 79 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/console
versions git=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 39s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 9s master passed
+1 💚 compile 0m 50s master passed
+1 💚 shadedjars 5m 49s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 26s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 43s the patch passed
+1 💚 compile 0m 53s the patch passed
+1 💚 javac 0m 53s the patch passed
+1 💚 shadedjars 5m 46s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 28s the patch passed
_ Other Tests _
-1 ❌ unit 272m 9s hbase-server in the patch failed.
297m 16s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #5668
Optional Tests javac javadoc unit shadedjars compile
uname Linux 022e79aeb678 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e85557a
Default Java Temurin-1.8.0_352-b08
unit https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/testReport/
Max. process+thread count 4767 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 42s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 33s master passed
+1 💚 compile 1m 1s master passed
+1 💚 shadedjars 6m 4s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 29s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 52s the patch passed
+1 💚 compile 0m 59s the patch passed
+1 💚 javac 0m 59s the patch passed
+1 💚 shadedjars 6m 49s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 37s the patch passed
_ Other Tests _
+1 💚 unit 288m 18s hbase-server in the patch passed.
316m 58s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #5668
Optional Tests javac javadoc unit shadedjars compile
uname Linux fc3cfd8c4994 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e85557a
Default Java Eclipse Adoptium-11.0.17+8
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/testReport/
Max. process+thread count 4945 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5668/3/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@bbeaudreault bbeaudreault merged commit 98eb3e0 into apache:master Feb 8, 2024
1 check failed
@bbeaudreault bbeaudreault deleted the HBASE-28349 branch February 8, 2024 21:16
bbeaudreault pushed a commit that referenced this pull request Feb 8, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
bbeaudreault pushed a commit to HubSpot/hbase that referenced this pull request Feb 8, 2024
…otas (apache#5668)

Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
rmdmattingly added a commit to HubSpot/hbase that referenced this pull request Feb 8, 2024
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants