liuxiaocs7 opened a new pull request, #8839:
URL: https://github.com/apache/hbase/pull/8839
## Summary
Backport of HBASE-30504 (#8824) to branch-2.5, from the branch-2.6 commit.
- for branch-2.5
- see: HBASE-30504
`HStore` has registered its `CacheConfig` with the `ConfigurationManager`
since HBASE-28517 (2.5.9). On `update_config`, `CacheConfig` rereads the global
settings and drops the column family settings. With this change, the
constructor and `onConfigurationChange` use the same rule:
```diff
onConfigurationChange(conf)
- cacheDataOnRead = global cacheonread
- cacheDataOnWrite = global cacheblocksonwrite
- evictOnClose = global evictblocksonclose
+ updateCacheSettings(conf) // also called by the constructor
```
The rule differs from master and branch-2.6. HBASE-29623 is not on
branch-2.5, so `BLOCKCACHE => false` only disables data block caching on read.
Cache on write and evict on close keep the existing branch-2.5 construction
semantics:
```diff
updateCacheSettings(conf)
cacheDataOnRead = familyBlockCacheEnabled && global
- cacheDataOnWrite = familyBlockCacheEnabled && (global || family) //
master / branch-2.6
- evictOnClose = familyBlockCacheEnabled && (global || family) //
master / branch-2.6
+ cacheDataOnWrite = global || family //
branch-2.5
+ evictOnClose = global || family //
branch-2.5
```
The expectations in `TestCacheConfigOnConfigurationChange` for cache on
write and evict on close are adjusted the same way.
## Evidence
- **Before:** with the test applied to the old `CacheConfig`,
`TestCacheConfigOnConfigurationChange` fails 14/18. One example:
```text
family BLOCKCACHE => false, global config unchanged
notifyAllObservers(conf)
shouldCacheDataOnRead() expected: <false> but was: <true>
```
**After:** `TestCacheConfigOnConfigurationChange` 18/18, `TestCacheConfig`
8/8, `TestHStore` 47/47 pass.
## Merge Danger
**Door:** two-way
This change only adds private fields and a private method. Nothing is
persisted, so a revert restores the previous behavior.
**Blast Radius:** RegionServer block cache
After `update_config`, column families with `BLOCKCACHE => false` no longer
cache data blocks on read. The column family `CACHE_DATA_ON_WRITE` and
`EVICT_BLOCKS_ON_CLOSE` settings stay in effect. Values computed when the store
opens are unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]