diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMultipleMergedRegionsProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMultipleMergedRegionsProcedure.java index 8042d6172f3..4fc5484aca8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMultipleMergedRegionsProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/GCMultipleMergedRegionsProcedure.java @@ -97,7 +97,16 @@ public class GCMultipleMergedRegionsProcedure extends try { switch (state) { case GC_MERGED_REGIONS_PREPARE: - // Nothing to do to prepare. + // If GCMultipleMergedRegionsProcedure processing is slower than the CatalogJanitor's scan + // interval, it will end resubmitting GCMultipleMergedRegionsProcedure for the same + // region, we can skip duplicate GCMultipleMergedRegionsProcedure while previous finished + List parents = MetaTableAccessor.getMergeRegions( + env.getMasterServices().getConnection(), mergedChild.getRegionName()); + if (parents == null || parents.isEmpty()) { + LOG.info("Region=" + mergedChild.getShortNameToLog() + + " info:merge qualifier has been deleted"); + return Flow.NO_MORE_STATE; + } setNextState(GCMergedRegionsState.GC_MERGED_REGIONS_PURGE); break; case GC_MERGED_REGIONS_PURGE: