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) @@ -817,13 +817,14 @@ " because one (major) compacted file only and oldestTime " + oldest + "ms is < ttl=" + this.ttl); } - } else if (this.ttl != HConstants.FOREVER && oldest > this.ttl) { + } else if (this.ttl != HConstants.FOREVER && oldest > this.ttl + && filesToCompact.size() < this.maxFilesToCompact) { LOG.debug("Major compaction triggered on store " + this.storeNameStr + ", because keyvalues outdated; time since last major compaction " + (now - lowTimestamp) + "ms"); result = true; } - } else { + } else if (filesToCompact.size() < this.maxFilesToCompact) { if (LOG.isDebugEnabled()) { LOG.debug("Major compaction triggered on store " + this.storeNameStr + "; time since last major compaction " + (now - lowTimestamp) + "ms");