Skip to content

HBASE-28600 Introduce hfile.block.cache.memory.size configuration - #6422

Merged
ndimiduk merged 4 commits into
apache:masterfrom
jinhyukify:HBASE-28600
Dec 10, 2024
Merged

HBASE-28600 Introduce hfile.block.cache.memory.size configuration#6422
ndimiduk merged 4 commits into
apache:masterfrom
jinhyukify:HBASE-28600

Conversation

@jinhyukify

Copy link
Copy Markdown
Contributor

Introduce a new configuration, hfile.block.cache.memory.size, which allows setting the block cache size with an exact byte value or a human-readable storage size.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimidukndimiduk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks really good. I have just some small comments. Have you tried it out? Is it working for you?

if (usage != null) {
max = usage.getMax();
}
final long heapMax = usage != null ? usage.getMax() : -1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we throw when heapMax == -1? We don't have any safety on subsequent divide by -1, below.

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.

What do you think of immediately returning -1 in this case?
We expect this method to return a negative value when the cache is disabled.

finallongcacheSize = MemorySizeUtil.getOnHeapCacheSize(c);
if (cacheSize < 0) {
returnnull;
}

if (blockCachePercent < blockCachePercentMinRange) {
LOG.warn("Setting " + BLOCK_CACHE_SIZE_MIN_RANGE_KEY + " to " + blockCachePercent
+ ", same value as " + HFILE_BLOCK_CACHE_SIZE_KEY
+ " (lookup order: " + HFILE_BLOCK_CACHE_MEMORY_SIZE_KEY + " -> "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: please cleanup any modified log lines to use modern style parameter substitution.

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.

Thank you. updated.

@jinhyukifyjinhyukify left a comment

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.

Have you tried it out? Is it working for you?

I briefly wrote down the developer test I performed on my local machine.
You can check it in this comment

if (blockCachePercent < blockCachePercentMinRange) {
LOG.warn("Setting " + BLOCK_CACHE_SIZE_MIN_RANGE_KEY + " to " + blockCachePercent
+ ", same value as " + HFILE_BLOCK_CACHE_SIZE_KEY
+ " (lookup order: " + HFILE_BLOCK_CACHE_MEMORY_SIZE_KEY + " -> "

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.

Thank you. updated.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimidukndimiduk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice thank you!

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 31sDocker 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 11sMaven dependency ordering for branch
+1 💚mvninstall3m 12smaster passed
+1 💚compile3m 46smaster passed
+1 💚checkstyle0m 49smaster passed
+1 💚spotbugs2m 2smaster passed
+0 🆗refguide2m 20sbranch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚spotless0m 46sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 3sthe patch passed
+1 💚compile3m 46sthe patch passed
+1 💚javac3m 46sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 48sthe patch passed
+1 💚xmllint0m 0sNo new issues.
+1 💚spotbugs2m 21sthe patch passed
+0 🆗refguide2m 4spatch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚hadoopcheck11m 28sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 44spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
45m 39s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6422/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6422
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless xmllint refguide
unameLinux c194f512c438 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 / a401560
Default JavaEclipse Adoptium-17.0.11+9
refguidehttps://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-6422/4/yetus-general-check/output/branch-site/book.html
refguidehttps://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-6422/4/yetus-general-check/output/patch-site/book.html
Max. process+thread count86 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6422/4/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3 xmllint=20913
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 43sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed 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 15sMaven dependency ordering for branch
+1 💚mvninstall2m 43smaster passed
+1 💚compile1m 17smaster passed
+1 💚javadoc0m 45smaster passed
+1 💚shadedjars5m 0sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall3m 8sthe patch passed
+1 💚compile1m 17sthe patch passed
+1 💚javac1m 17sthe patch passed
+1 💚javadoc0m 44sthe patch passed
+1 💚shadedjars4m 51spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit2m 6shbase-common in the patch passed.
-1 ❌unit26m 42s/patch-unit-hbase-server.txthbase-server in the patch failed.
52m 17s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6422/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6422
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 09253916f505 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a401560
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6422/4/testReport/
Max. process+thread count2036 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6422/4/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@ndimiduk
ndimiduk merged commit c4fed77 into apache:masterDec 10, 2024
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Dec 10, 2024
ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Dec 10, 2024
@ndimiduk

Copy link
Copy Markdown
Member

I think that this change is benign enough for our active release lines. @apurtell do you have any objection to adding this to branch-2.5?

ndimiduk pushed a commit to ndimiduk/hbase that referenced this pull request Dec 10, 2024
ndimiduk added a commit that referenced this pull request Dec 13, 2024
…6529)
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: JinHyuk Kim <tk5641@naver.com>
gvprathyusha6 pushed a commit to gvprathyusha6/hbase that referenced this pull request Dec 19, 2024
apurtell pushed a commit that referenced this pull request Jan 14, 2025
#6422)" to branch-2 (#6544)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
apurtell pushed a commit that referenced this pull request Jan 14, 2025
#6422)" to branch-2.6 (#6545)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
apurtell pushed a commit that referenced this pull request Jan 14, 2025
#6422)" to branch-2.5 (#6592)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
apache#6422)" to branch-2 (apache#6544)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
sanjeet006py pushed a commit to sanjeet006py/hbase that referenced this pull request Sep 26, 2025
apache#6422)" to branch-2.5 (apache#6592)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
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.

3 participants

@jinhyukify@Apache-HBase@ndimiduk