You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2018/04/18 02:22:00 UTC

[jira] [Commented] (HBASE-20447) Only fail cacheBlock if block collisions aren't related to next block metadata

    [ https://issues.apache.org/jira/browse/HBASE-20447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16441782#comment-16441782 ] 

Ted Yu commented on HBASE-20447:
--------------------------------

{code}
+   * if not, throw an exception. If they are the same without the nextBlockMetadata, return the comparison.
{code}
RuntimeException is thrown. Have you considered throwing IOE ?
{code}
+      LOG.warn("Cached block contents differ, trying to just compare the block contents " +
+          "without the next block. CacheKey: " + cacheKey);
{code}
Is there anything admin can do after seeing the above log ?
{code}
+          LOG.warn("Cached block contents differ by nextBlockOnDiskSize. Keeping cached block.");
+          return;
+        } else {
+          LOG.warn("Cached block contents differ by nextBlockOnDiskSize. Caching new block.");
{code}
The first part of the log is the same for both cases. Is it possible to make the log clearer as to why the decision of caching is made ?
{code}
+    if (includeNextBlockMetadata) {
+      destination.putInt(this.nextBlockOnDiskSize);
{code}
The flag only guards one field. Would includeNextBlockOnDiskSize be better name for the parameter ?

> Only fail cacheBlock if block collisions aren't related to next block metadata
> ------------------------------------------------------------------------------
>
>                 Key: HBASE-20447
>                 URL: https://issues.apache.org/jira/browse/HBASE-20447
>             Project: HBase
>          Issue Type: Bug
>          Components: BlockCache, BucketCache
>    Affects Versions: 1.4.3, 2.0.0
>            Reporter: Zach York
>            Assignee: Zach York
>            Priority: Major
>         Attachments: HBASE-20447.branch-1.001.patch
>
>
> This is the issue I was originally having here: [http://mail-archives.apache.org/mod_mbox/hbase-dev/201802.mbox/%3CCAN+qs_Pav=md_Aoj4Xji+KCNETubg2XOu2nTxV1g6m8-5VN-GA@mail.gmail.com%3E]
>  
> When we pread, we don't force the read to read all of the next block header.
> However, when we get into a race condition where two opener threads try to
> cache the same block and one thread read all of the next block header and the other one didn't, it will fail the open process. This is especially important
> in a splitting case where it will potentially fail the split process.
> Instead, in the caches, we should only fail if the required blocks are different.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)