[ https://issues.apache.org/jira/browse/HBASE-5041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175132#comment-13175132 ]
Shrijeet Paliwal commented on HBASE-5041: ----------------------------------------- Our logic to check if the name is a regionname or tablename is designed to be as follows: tl;dr: If it is not an existing table, its should be a region. {noformat} /** * @param tableNameOrRegionName Name of a table or name of a region. * @return True if <code>tableNameOrRegionName</code> is *possibly* a region * name else false if a verified tablename (we call {@link #tableExists(byte[])}; * else we throw an exception. * @throws IOException */ private boolean isRegionName(final byte [] tableNameOrRegionName) throws IOException { if (tableNameOrRegionName == null) { throw new IllegalArgumentException("Pass a table name or region name"); } return !tableExists(tableNameOrRegionName); } {noformat} My plan was to modify majorCompact function's else block to check if the table exist and throw TableNotFoundException if it does not. But because of name logic one will never reach 'else' part and a compaction request will be registered assuming it must be a region. > Major compaction on non existing table does not throw error > ------------------------------------------------------------ > > Key: HBASE-5041 > URL: https://issues.apache.org/jira/browse/HBASE-5041 > Project: HBase > Issue Type: Bug > Components: regionserver, shell > Affects Versions: 0.90.3 > Reporter: Shrijeet Paliwal > > Following will not complain even if fubar does not exist > {code} > echo "major_compact 'fubar'" | $HBASE_HOME/bin/hbase shell > {code} > The downside for this defect is that major compaction may be skipped due to > a typo by Ops. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira