You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Wellington Chevreuil (Jira)" <ji...@apache.org> on 2026/10/05 09:57:00 UTC

[jira] [Commented] (HBASE-30454) BucketCache persistence recovery downgrades MULTI blocks to SINGLE

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

Wellington Chevreuil commented on HBASE-30454:
----------------------------------------------

Thanks for reporting this, [~juliancs]! If you are planning to work on a fix, please assign this Jira to yourself, I have added you to the list of contributors, so you should be able to own HBase jiras now.

> BucketCache persistence recovery downgrades MULTI blocks to SINGLE
> ------------------------------------------------------------------
>
>                 Key: HBASE-30454
>                 URL: https://issues.apache.org/jira/browse/HBASE-30454
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Julian Chandra Sutadi
>            Priority: Major
>
> HBASE-29667 reported that blocks written into the BucketCache were initialized with MULTI priority instead of SINGLE, so the SINGLE to MULTI promotion on re-access never took effect. The issue was fixed by initializing non-memory blocks as SINGLE in the BucketEntry constructor.
> However, when the cache is restored from its persistence file (BucketProtoUtils.fromPB), the BucketEntry is rebuilt from its boolean inMemory instead of the saved priority. The constructor sets MEMORY if inMemory is true and SINGLE otherwise, so a persisted MULTI block comes back as SINGLE. After a restart, frequently accessed blocks silently lose their MULTI status and are more likely to be evicted until they are read again.
> {code:java}
> // BucketProtoUtils.toPB(BucketEntry): saves all three priorities
> .setPriority(toPB(entry.getPriority()))
> // BucketProtoUtils.fromPB: reduces the priority to a boolean
> new BucketEntry(..., protoValue.getCachedTime(),
>   protoValue.getPriority() == BucketCacheProtos.BlockPriority.memory,   // inMemory
>   createRecycler, ByteBuffAllocator.HEAP);
> // BucketEntry constructor (fixed by HBASE-29667)
> this.priority = inMemory ? BlockPriority.MEMORY : BlockPriority.SINGLE;
> {code}
> The suggested fix is to restore the enum directly, mirroring the existing toPB(BlockPriority). We will submit the fix proposal soon.



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