Ke Han created HBASE-28187:
------------------------------
Summary: NPE when flush a non-existing column family
Key: HBASE-28187
URL: https://issues.apache.org/jira/browse/HBASE-28187
Project: HBase
Issue Type: Bug
Reporter: Ke Han
Flush a columnfamily that doesn't exist in the table will cause NPE ERROR in
both shell and the HMaster logs.
h1. Reproduce
Start up HBase 2.5.5 cluster, executing the following commands with hbase shell
in HMaster node will lead to NPE.
{code:java}
create 'table7', {NAME => 'cf1', VERSIONS => 2, COMPRESSION => 'GZ',
BLOOMFILTER => 'ROWCOL'}, {NAME => 'cf2', VERSIONS => 4, COMPRESSION => 'NONE',
BLOOMFILTER => 'ROWCOL'}
incr 'table7', 'row1', 'cf1:cell', 2
flush 'table7', 'cf3'{code}
The shell outputs
{code:java}
hbase:006:0> create 'table', {NAME => 'cf1', VERSIONS => 2, COMPRESSION =>
'GZ', BLOOMFILTER => 'ROWCOL'}, {NAME => 'cf2', VERSIONS => 4, COMPRESSION =>
'NONE', BLOOMFILTER => 'ROWCOL'}
Created table table
Took 2.1238 seconds
=> Hbase::Table - table
hbase:007:0>
hbase:008:0> incr 'table', 'row1', 'cf1:cell', 2
COUNTER VALUE = 2
Took 0.0131 seconds
hbase:009:0>
hbase:010:0> flush 'table', 'cf3'
ERROR: java.io.IOException: java.lang.NullPointerException
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:479)
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:
org.apache.hadoop.hbase.errorhandling.ForeignException$ProxyThrowable:
java.lang.NullPointerException
at
org.apache.hadoop.hbase.procedure.flush.RegionServerFlushTableProcedureManager$FlushTableSubprocedurePool.waitForOutstandingTasks(RegionServerFlushTableProcedureManager.java:274)
at
org.apache.hadoop.hbase.procedure.flush.FlushTableSubprocedure.flushRegions(FlushTableSubprocedure.java:115)
at
org.apache.hadoop.hbase.procedure.flush.FlushTableSubprocedure.acquireBarrier(FlushTableSubprocedure.java:126)
at org.apache.hadoop.hbase.procedure.Subprocedure.call(Subprocedure.java:160)
at org.apache.hadoop.hbase.procedure.Subprocedure.call(Subprocedure.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
For usage try 'help "flush"'
Took 12.1713 seconds
hbase:011:0> {code}
According to the flush command specification, user could flush a specific
column family.
{code:java}
sh all regions in passed table or pass a region row to
flush an individual region or a region server name whose format
is 'host,port,startcode', to flush all its regions.
You can also flush a single column family for all regions within a table,
or for an specific region only.
For example:
hbase> flush 'TABLENAME'
hbase> flush 'TABLENAME','FAMILYNAME' {code}
In the above case, *cf3* an incorrect input (non-existing column family). If
user tries to flush it, the expected output is:
# HBase rejects this operation
# returns a prompt saying the column family doesn't exist {_}"{_}_ERROR:
Unknown CF..."._
It can be reproduced deterministically with the above commands.
h1. Root Cause
There's a missing check for the whether the target flushing columnfamily exists.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)