Skip to content

HBASE-30329 Add topology-backed cache diagnostics - #8575

Open
VladRodionov wants to merge 1 commit into
apache:HBASE-30018from
VladRodionov:HBASE-30329-topology-cache-diagnostics
Open

HBASE-30329 Add topology-backed cache diagnostics#8575
VladRodionov wants to merge 1 commit into
apache:HBASE-30018from
VladRodionov:HBASE-30329-topology-cache-diagnostics

Conversation

@VladRodionov

Copy link
Copy Markdown
Contributor

Summary

This PR extends the topology-backed cache access framework so that cache diagnostics and cache
access are consistently routed through TopologyBackedCacheAccessService.

The main change is that plain single-tier BlockCache implementations now use the same
topology-backed access path as combined caches. Single-tier caches are represented by
SingleTierTopology, while existing two-tier cache variants continue to use topology-specific
representations:

  • BlockCache -> SingleTierTopology
  • CombinedBlockCache -> TieredExclusiveTopology
  • InclusiveCombinedBlockCache -> TieredInclusiveTopology

This keeps the legacy cache implementations underneath through BlockCacheBackedCacheEngine, but
moves the access-service boundary to the topology/cache-engine model.

Motivation

After HBASE-30305, exclusive combined-cache orchestration was moved behind
TopologyBackedCacheAccessService. Follow-up testing showed that diagnostic and compatibility paths
still had assumptions about BlockCacheBackedCacheAccessService and concrete BlockCache
implementations.

This PR removes those assumptions from the main factory path by making topology-backed access the
normal path for both single-tier and combined caches.

Changes

  • Added SingleTierTopology.
  • Added CacheTopologyType.SINGLE_TIER.
  • Added topology-backed factory support for single-tier BlockCache instances.
  • Added explicit topology-backed support for InclusiveCombinedBlockCache.
  • Preserved separate semantics for exclusive and inclusive combined caches:
    • exclusive promotion moves a block between tiers;
    • inclusive promotion copies a block and keeps the source tier;
    • inclusive eviction evicts from all tiers.
  • Added cached-block iterable diagnostics through the topology-backed service.
  • Preserved legacy default cacheBlock(key, block) behavior for single-tier caches.
  • Added test helpers for unwrapping legacy BlockCache instances from topology-backed services
    where tests still need direct compatibility checks.
  • Added focused tests for:
    • single-tier topology-backed cache access;
    • exclusive combined-cache compatibility;
    • inclusive combined-cache compatibility.

Compatibility notes

BlockCacheBackedCacheAccessService is no longer the default factory result for plain block caches.
Instead, the main factory now returns a TopologyBackedCacheAccessService backed by
SingleTierTopology.

The underlying legacy BlockCache implementations are still preserved through
BlockCacheBackedCacheEngine. This PR does not migrate LruBlockCache, BucketCache, or other
concrete cache implementations to native CacheEngine implementations yet. That remains a follow-up
migration step.

Testing

Focused tests:

mvn -pl hbase-server \
  -Dtest=TestSingleTierTopologyBackedCacheAccessService test

mvn -pl hbase-server \
  -Dtest=TestCombinedBlockCacheCompatibleTopologyBackedCacheAccessService test

mvn -pl hbase-server \
  -Dtest=TestInclusiveCombinedBlockCacheCompatibleTopologyBackedCacheAccessService test

mvn -pl hbase-server \
  -Dtest=TestHFile test

mvn -pl hbase-server \
  -Dtest=TestBlockCacheReporting test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant