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/08 09:23:00 UTC
[jira] [Resolved] (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:all-tabpanel ]
Wellington Chevreuil resolved HBASE-30454.
------------------------------------------
Resolution: Fixed
Merged into master, branch-3, branch-3 and branch-2.6. Thanks for the contribution, [~juliancs] !
> 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
> Affects Versions: 3.0.0, 2.7.0, 2.6.7
> Reporter: Julian Chandra Sutadi
> Assignee: Julian Chandra Sutadi
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.7.0, 3.1.0, 2.6.8
>
>
> 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)