[
https://issues.apache.org/jira/browse/HBASE-28296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17804359#comment-17804359
]
guluo commented on HBASE-28296:
-------------------------------
Thanks for your reply [~bbeaudreault].
In the following situation, I tested that hbase would not compact immediately
when the number of storefile exceeded hbase.hstore.compaction.min.
*I frequently execute flush table or region from HBase shell or HBaseAdmin in a
short period of time, which would generate many storefiles*
Only the CompactionChecker will check it periodically, and hbase would compact
if it needs to compact, and the interval between checks is
hbase.server.compactchecker.interval.multiplier *
hbase.server.thread.wakefrequency (by default, about 2 hours and 46 minutes).
I means that we can send compact request in advance if it need by checking the
HRegion.FlushResult, instead of waiting for 2 hours (worst-case scenario)
The benefit of doing this is that we can prevent the rapid growth of the number
of hfile even if we frequently execute flush
> Sending compact request if necessary after flushing at server side
> ------------------------------------------------------------------
>
> Key: HBASE-28296
> URL: https://issues.apache.org/jira/browse/HBASE-28296
> Project: HBase
> Issue Type: Improvement
> Components: Compaction
> Reporter: guluo
> Priority: Major
>
> By default, hbase would automatically compact periodically.
> However, In this period, what we flush frequently would cause many hfile
> genereated, and hbase does not compact until the next period.
> So in order to prevent the rapid growth of the number of hfile under some
> conditions, I think we can add a check if it needs to compact after flushing
> region at server side.
> Do you think it's a better way? thanks!
>
> One of the codes in here:
> {code:java}
> //FlushRegionCallable.java doCall()
> try {
> HRegion.FlushResult res;
> if (columnFamilies == null) {
> res = region.flush(true);
> } else {
> res = region.flushcache(columnFamilies, false,
> FlushLifeCycleTracker.DUMMY);
> }
> if (res.getResult() == HRegion.FlushResult.Result.CANNOT_FLUSH) {
> throw new IOException("Unable to complete flush " + regionInfo);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)