diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 3c958d57bfa..176da9de825 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -1298,7 +1298,7 @@ public class HRegion implements HeapSize { // , Writable{ *

This method may block for some time, so it should not be called from a * time-sensitive thread. * - * @return true if cache was flushed + * @return true if the region needs compacting * * @throws IOException general io exceptions * @throws DroppedSnapshotException Thrown when replay of hlog is required diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 52ae22ca71f..5267597efa9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -3607,7 +3607,12 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa } FlushRegionResponse.Builder builder = FlushRegionResponse.newBuilder(); if (shouldFlush) { - builder.setFlushed(region.flushcache()); + boolean result = region.flushcache(); + if (result) { + this.compactSplitThread.requestCompaction(region, + "Compaction through user triggered flush"); + } + builder.setFlushed(result); } builder.setLastFlushTime(region.getLastFlushTime()); return builder.build();