HBASE-30305 Replace CombinedBlockCache orchestration with TieredExclusiveTopology-backed CacheAccessService - #8522
Conversation
There was a problem hiding this comment.
Pull request overview
This PR advances the block-cache migration in hbase-server by switching the combined L1/L2 orchestration path from the legacy CombinedBlockCache-wrapped BlockCacheBackedCacheAccessService to a topology-driven TopologyBackedCacheAccessService using TieredExclusiveTopology, while keeping CombinedBlockCache available for legacy BlockCache APIs.
Changes:
- Update
CacheAccessServices.fromBlockCache(...)to return a topology-backed cache access service when the input is aCombinedBlockCache. - Add a
TopologyBackedCacheAccessServices.fromCombinedBlockCache(...)construction path that extracts L1/L2 block caches and assembles aTieredExclusiveTopology. - Extend compatibility APIs (e.g.,
shouldCacheFile,shouldCacheBlock, fully-cached file visibility, completion notifications) and add/adjust tests for the new wiring.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDataTieringManager.java | Adds diagnostics around fully-cached-file waiting; removes an unused helper. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java | Adjusts combined-cache test setup (currently by commenting an assertion). |
| hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/cache/TestTopologyBackedCacheAccessServices.java | Adds tests for constructing a topology-backed service from CombinedBlockCache. |
| hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/cache/TestCacheAccessServices.java | Adds coverage for CacheAccessServices.fromBlockCache(...) behavior (regular vs combined). |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java | Enhances “combined cache” detection to include topology-backed compatibility. |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/TopologyBackedCacheAccessServices.java | Adds fromCombinedBlockCache(...) helpers for wiring L1/L2 into TieredExclusiveTopology. |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/TopologyBackedCacheAccessService.java | Implements combined-cache compatibility behaviors across engines and propagates notifications. |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/CacheEngine.java | Adds default optional hooks for file/block admission and fully-cached-file reporting. |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/CacheAccessServices.java | Routes CombinedBlockCache to topology-backed service construction. |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/CacheAccessService.java | Adds null checks, propagates block category in default cache writes, and adds getFullyCachedFiles(). |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/BlockCacheBackedCacheEngine.java | Delegates new compatibility hooks to the underlying legacy BlockCache. |
| hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/cache/BlockCacheBackedCacheAccessService.java | Exposes getFullyCachedFiles() through the legacy-backed service. |
| hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureBypass.java | Whitespace-only change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
taklwu
left a comment
There was a problem hiding this comment.
can you run mvn spotless:apply and fix the spotless first ?
taklwu
left a comment
There was a problem hiding this comment.
below tests are failing, can you check ?
TestCacheConfig.testBucketCacheConfigL1L2Setup
TestCacheConfig.testFileBucketCacheConfig
TestCacheConfig.testOffHeapBucketCacheConfig
…siveTopology-backed CacheAccessService
945f39d to
d283f21
Compare
|
TestProcDispatcher failed but it should be unrelated, let's wait for your next commit and try again. |
|
I routinely run This is probably checkstyle error, which spotless can catch. Will double check. Checkstyle outputs a lot of errors, it's hard to catch which one you are responsible for. |
I thought you have the access to download the result, where the patch-spotless.txt shows the error is from I recalled running mvn spotless:apply at the root level would fix the problem, doesn't it ? there is another checkstyle error |
Summary
This PR replaces
CombinedBlockCacheas the primaryCacheAccessServiceorchestration path for combined L1/L2 block cache access.The previous compatibility path exposed a
CombinedBlockCachethroughBlockCacheBackedCacheAccessService. With the topology-backed cache architecture in place, the combined cache path can now be represented as:CombinedBlockCacheis not removed in this PR. It remains available as a legacyBlockCacheobject and for code paths that still depend on the old API. This PR moves the migration-facing cache access path toTopologyBackedCacheAccessService.Changes
CacheAccessServices.fromBlockCache(...)soCombinedBlockCacheis exposed as a topology-backedCacheAccessService.TopologyBackedCacheAccessServices.fromCombinedBlockCache(...)to extract L1/L2 caches fromCombinedBlockCacheand assemble aTieredExclusiveTopology.BlockCachebehavior by continuing to useBlockCacheBackedCacheAccessServicefor non-combined caches.shouldCacheFile(...);shouldCacheBlock(...);Why this is needed
The pluggable block cache architecture is moving from implicit orchestration inside
CombinedBlockCachetoward explicit cache topology.Legacy path:
New path:
This is the next migration step after:
BlockCacheBackedCacheEngineCompatibility notes
This PR does not remove
CombinedBlockCache.Existing concrete caches such as
LruBlockCacheandBucketCachestill implementBlockCache. They are adapted toCacheEnginethroughBlockCacheBackedCacheEngine.The goal is to move orchestration to the topology-backed access path while keeping existing cache implementations and legacy APIs intact.
Out of scope
CombinedBlockCache.LruBlockCache,BucketCache,TinyLfuBlockCache, orLruAdaptiveBlockCacheto implementCacheEngine.BlockCacheBackedCacheAccessService.Testing
Ran:
AI assistance disclosure
This PR was prepared with assistance from ChatGPT. All changes were reviewed, tested, and submitted by the author.