You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "ConfX (Jira)" <ji...@apache.org> on 2024/04/05 07:39:00 UTC

[jira] [Updated] (HBASE-27986) Adding debug message and assertion for failed BlockCache creation

     [ https://issues.apache.org/jira/browse/HBASE-27986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ConfX updated HBASE-27986:
--------------------------
    Summary: Adding debug message and assertion for failed BlockCache creation  (was: Null Pointer Exception when running testLruBlockCache with a misconfiguration)

> Adding debug message and assertion for failed BlockCache creation
> -----------------------------------------------------------------
>
>                 Key: HBASE-27986
>                 URL: https://issues.apache.org/jira/browse/HBASE-27986
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: ConfX
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: reproduce.sh
>
>
> h2. What happened
> After setting {{{}hfile.block.cache.size=1.1175870895385742E-8{}}}, running test {{org.apache.hadoop.hbase.io.hfile.TestBlockCacheReporting#testLruBlockCache}} results in a {{{}NullPointerException{}}}.
> h2. Where's the bug
> In the test {{{}org.apache.hadoop.hbase.io.hfile.TestBlockCacheReporting#testLruBlockCache{}}}:
> {code:java}
>     BlockCache blockCache = BlockCacheFactory.createBlockCache(this.conf);
>     logPerBlock(blockCache);
>     addDataAndHits(blockCache, 3); {code}
> Here the returned blockCache could be null, but is directly used as the parameter of {{logPerBlock}} without checking.
> h2. How to reproduce
>  # Set {{hfile.block.cache.size=1.1175870895385742E-8}}
>  # Run {{org.apache.hadoop.hbase.io.hfile.TestBlockCacheReporting#testLruBlockCache}}
> and the following exception should be observed:
> {code:java}
> java.lang.NullPointerException	at org.apache.hadoop.hbase.io.hfile.TestBlockCacheReporting.logPerBlock(TestBlockCacheReporting.java:147)	at org.apache.hadoop.hbase.io.hfile.TestBlockCacheReporting.testLruBlockCache(TestBlockCacheReporting.java:100) {code}
> {{}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)