Xiao Liu created HBASE-30504:
--------------------------------
Summary: CacheConfig#onConfigurationChange ignores column family
cache settings
Key: HBASE-30504
URL: https://issues.apache.org/jira/browse/HBASE-30504
Project: HBase
Issue Type: Bug
Components: BlockCache
Reporter: Xiao Liu
Assignee: Xiao Liu
Fix For: 4.0.0-alpha-1, 2.7.0, 3.1.0, 3.0.1, 2.6.8
{\{CacheConfig}} combines the global configuration with the column family
settings when it is created. A family with \{{BLOCKCACHE => false}} does not
cache data blocks, and the family's \{{CACHE_DATA_ON_WRITE}} and
\{{EVICT_BLOCKS_ON_CLOSE}} take effect even when the global settings are off.
{\{CacheConfig#onConfigurationChange}}, added in HBASE-28517, only rereads the
global settings and overwrites these values. \{{HStore}} registers its
\{{CacheConfig}} with the \{{ConfigurationManager}}, so any \{{update_config}},
even one that changes no cache setting, has these effects on every open store:
* \{{BLOCKCACHE => false}}: data blocks are cached on read again. If
\{{hbase.rs.cacheblocksonwrite}} is true, they are also cached on write, which
HBASE-29623 fixed.
* \{{CACHE_DATA_ON_WRITE => true}}: cache on write is turned off unless enabled
globally.
* \{{EVICT_BLOCKS_ON_CLOSE => true}}: evict on close is turned off unless
enabled globally.
The wrong values remain until the region is reopened.
The fix is to retain the family settings in \{{CacheConfig}} and use the same
logic at construction and on reload.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)