Source:
<code>public void compactAll(long compactionId, UserCompactionConfig compactionConfig) { boolean updateMetadata = false; synchronized (this) { <START> if (lastCompactID >= compactionId && compactionConfig.getIterators().isEmpty()) <END> return; if (isMinorCompactionRunning()) { if (compactionWaitInfo.compactionID == compactionId) { if (lastFlushID == compactionWaitInfo.flushID) return; } else { compactionWaitInfo.compactionID = compactionId; compactionWaitInfo.flushID = lastFlushID; return; } } if (isClosing() || isClosed() || majorCompactionQueued.contains(MajorCompactionReason.USER) || isMajorCompactionRunning()) return; if (getDatafileManager().getDatafileSizes().size() == 0) { updateMetadata = true; lastCompactID = compactionId; } { CompactionStrategyConfig strategyConfig = compactionConfig.getCompactionStrategy(); CompactionStrategy strategy = createCompactionStrategy(strategyConfig); MajorCompactionRequest request = new MajorCompactionRequest(extent, MajorCompactionReason.USER, getTabletServer().getFileSystem(), tableConfiguration); request.setFiles(getDatafileManager().getDatafileSizes()); try { if (strategy.shouldCompact(request)) { initiateMajorCompaction(MajorCompactionReason.USER); } else { majorCompactionState = CompactionState.IN_PROGRESS; updateMetadata = true; lastCompactID = compactionId; } } catch (IOException e) { throw new RuntimeException(e); } } } if (updateMetadata) { try { MetadataTableUtil.updateTabletCompactID(extent, compactionId, getTabletServer(), getTabletServer().getLock()); } finally { synchronized (this) { majorCompactionState = null; this.notifyAll(); } } } }</code><technical_language>If lastCompactID >= compactionId do anything. master receives compaction request increments counter in zookeeper. a tablet compacts, records compaction id in metadata. Master asking tablets compact tablets counter >= zookeeper value. This change lead tablet compacting multiple times for a single user compaction request iters</technical_language>

Target:
public void compactAll(long compactionId, UserCompactionConfig compactionConfig) { boolean updateMetadata = false; synchronized (this) { if (lastCompactID >= compactionId) return; if (isMinorCompactionRunning()) { if (compactionWaitInfo.compactionID == compactionId) { if (lastFlushID == compactionWaitInfo.flushID) return; } else { compactionWaitInfo.compactionID = compactionId; compactionWaitInfo.flushID = lastFlushID; return; } } if (isClosing() || isClosed() || majorCompactionQueued.contains(MajorCompactionReason.USER) || isMajorCompactionRunning()) return; CompactionStrategyConfig strategyConfig = compactionConfig.getCompactionStrategy(); CompactionStrategy strategy = createCompactionStrategy(strategyConfig); MajorCompactionRequest request = new MajorCompactionRequest(extent, MajorCompactionReason.USER, getTabletServer().getFileSystem(), tableConfiguration); request.setFiles(getDatafileManager().getDatafileSizes()); try { if (strategy.shouldCompact(request)) { initiateMajorCompaction(MajorCompactionReason.USER); } else { majorCompactionState = CompactionState.IN_PROGRESS; updateMetadata = true; lastCompactID = compactionId; } } catch (IOException e) { throw new RuntimeException(e); } } if (updateMetadata) { try { MetadataTableUtil.updateTabletCompactID(extent, compactionId, getTabletServer(), getTabletServer().getLock()); } finally { synchronized (this) { majorCompactionState = null; this.notifyAll(); } } } }