Index: src/main/java/org/apache/hadoop/hbase/regionserver/Store.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (revision 1139358) +++ src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (working copy) @@ -792,12 +792,20 @@ * @param filesToCompact Files to compact. Can be null. * @return True if we should run a major compaction. */ - private boolean isMajorCompaction(final List filesToCompact) throws IOException { + private boolean isMajorCompaction(final List filesToCompact) + throws IOException { boolean result = false; if (filesToCompact == null || filesToCompact.isEmpty() || majorCompactionTime == 0) { return result; - } + } + if (filesToCompact.size() >= this.maxFilesToCompact) { + LOG.debug("Skipping major compaction of " + this.storeNameStr + + " because there are " + filesToCompact.size() + + " files to compact which is greater than max of " + + this.maxFilesToCompact); + return result; + } // TODO: Use better method for determining stamp of last major (HBASE-2990) long lowTimestamp = getLowestTimestamp(filesToCompact); long now = System.currentTimeMillis();