Junegunn Choi created HBASE-30192:
-------------------------------------
Summary: Shell-set CF settings skip sanity checks
Key: HBASE-30192
URL: https://issues.apache.org/jira/browse/HBASE-30192
Project: HBase
Issue Type: Bug
Reporter: Junegunn Choi
h2. Problem
Since HBASE-20819 the shell writes CF {{CONFIGURATION}} into the values map.
{{ColumnFamilyDescriptor.getConfigurationValue}} reads only the legacy
configuration map, so {{TableDescriptorChecker.checkCompactionPolicy}}
(compaction-policy class, blocking storefile count) never sees shell-set
values. A FIFO policy created from the shell with default TTL is accepted when
it should be rejected.
Same root cause as HBASE-29314 / HBASE-30117, which fixed the map-reading sites
but missed the per-key reader.
h2. Steps to reproduce (hbase shell)
Start the shell and create a table with the FIFO compaction policy and a
default TTL (FOREVER).
h3. Without the patch
{noformat}
hbase:001:0> create 'fifo_test', { NAME => 'cf', CONFIGURATION => {
'hbase.hstore.defaultengine.compactionpolicy.class' =>
'org.apache.hadoop.hbase.regionserver.compactions.FIFOCompactionPolicy' } }
Created table fifo_test
{noformat}
- Table is created. TheĀ FIFO checks are skipped.
h3. With the patch
{noformat}
hbase:001:0> create 'fifo_test', { NAME => 'cf', CONFIGURATION => {
'hbase.hstore.defaultengine.compactionpolicy.class' =>
'org.apache.hadoop.hbase.regionserver.compactions.FIFOCompactionPolicy' } }
ERROR: org.apache.hadoop.hbase.DoNotRetryIOException: Default TTL is not
supported for FIFO compaction Set hbase.table.sanity.checks to false at conf or
table descriptor if you want to bypass sanity checks
at
org.apache.hadoop.hbase.util.TableDescriptorChecker.warnOrThrowExceptionForFailure(TableDescriptorChecker.java:365)
at
org.apache.hadoop.hbase.util.TableDescriptorChecker.warnOrThrowExceptionForFailure(TableDescriptorChecker.java:382)
at
org.apache.hadoop.hbase.util.TableDescriptorChecker.checkCompactionPolicy(TableDescriptorChecker.java:261)
at
org.apache.hadoop.hbase.util.TableDescriptorChecker.sanityCheck(TableDescriptorChecker.java:139)
at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:2511)
at
org.apache.hadoop.hbase.master.MasterRpcServices.createTable(MasterRpcServices.java:792)
at
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:461)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124)
at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:102)
at org.apache.hadoop.hbase.ipc.RpcHandler.run(RpcHandler.java:82)
Caused by: java.io.IOException: Default TTL is not supported for FIFO compaction
at
org.apache.hadoop.hbase.util.TableDescriptorChecker.lambda$checkCompactionPolicy$5(TableDescriptorChecker.java:293)
at
org.apache.hadoop.hbase.util.TableDescriptorChecker.warnOrThrowExceptionForFailure(TableDescriptorChecker.java:380)
... 9 more
{noformat}
- Rejected as expected.
h2. Fix
{{getConfigurationValue}} falls back to the values map (values win on
collision).
h2. Other affected sites
{{CustomCellTieredUtils.checkForModifyTable}} (custom-tiering feature branch,
HBASE-29427) reads the same accessor for the store-engine class and tiering
qualifier, so it has the identical bug on the alter/modify path and is fixed by
the same change.
h2. Follow-up (separate issue)
The values/configuration duality is the real defect. Long-term: make read-both
the only sanctioned CF read path and deprecate the standalone configuration
accessors. {{table_conf_unset}} is already an alias of {{{}table_att_unset{}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)