From f4a446c3d2e499298ee9c27a1a30e2273dccddd3 Mon Sep 17 00:00:00 2001 From: niuyulin Date: Wed, 6 May 2020 12:06:49 -0500 Subject: [PATCH] HBASE-24328 skip duplicate GCMultipleMergedRegionsProcedure while previous finished (#1629) Signed-off-by: huaxiangsun --- .../assignment/GCMultipleMergedRegionsProcedure.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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: