diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java index ef2a0054924..d02e5ae05d3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java @@ -214,6 +214,7 @@ public class CatalogJanitor extends ScheduledChore { int scan() throws IOException { try { if (!alreadyRunning.compareAndSet(false, true)) { + LOG.debug("CatalogJanitor already running"); return 0; } Triple, Map> scanTriple = diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java index 44b24cefcb7..e3f6cc27e2c 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransactionOnCluster.java @@ -268,8 +268,8 @@ public class TestRegionMergeTransactionOnCluster { cleaner.chore(); Thread.sleep(1000); } - int newcount1 = 0; while (System.currentTimeMillis() < timeout) { + int newcount1 = 0; for(HColumnDescriptor colFamily : columnFamilies) { newcount1 += hrfs.getStoreFiles(colFamily.getName()).size(); } @@ -280,10 +280,15 @@ public class TestRegionMergeTransactionOnCluster { } // run CatalogJanitor to clean merge references in hbase:meta and archive the // files of merging regions - int cleaned = admin.runCatalogScan(); + int cleaned = 0; + while (cleaned == 0) { + cleaned = admin.runCatalogScan(); + LOG.debug("catalog janitor returned " + cleaned); + Thread.sleep(50); + } + assertFalse(regionAdir.toString(), fs.exists(regionAdir)); + assertFalse(regionBdir.toString(), fs.exists(regionBdir)); assertTrue(cleaned > 0); - assertFalse(fs.exists(regionAdir)); - assertFalse(fs.exists(regionBdir)); mergedRegionResult = MetaTableAccessor.getRegionResult( master.getConnection(), mergedRegionInfo.getRegionName());