Index: hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java (revision 1374478) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/master/CatalogJanitor.java (working copy) @@ -153,14 +153,18 @@ // Now work on our list of found parents. See if any we can clean up. int cleaned = 0; - HashSet parentNotCleaned = new HashSet(); //regions whose parents are still around + //regions whose parents are still around + HashSet parentNotCleaned = new HashSet(); for (Map.Entry e : splitParents.entrySet()) { - if (!parentNotCleaned.contains(e.getKey()) && cleanParent(e.getKey(), e.getValue())) { + if (!parentNotCleaned.contains(e.getKey().getEncodedName()) && + cleanParent(e.getKey(), e.getValue())) { cleaned++; } else { - // We could not clean the parent, so it's daughters should not be cleaned either (HBASE-6160) - parentNotCleaned.add(getDaughterRegionInfo(e.getValue(), HConstants.SPLITA_QUALIFIER)); - parentNotCleaned.add(getDaughterRegionInfo(e.getValue(), HConstants.SPLITB_QUALIFIER)); + // We could not clean the parent, so its daughters should not be cleaned either(HBASE-6160) + parentNotCleaned.add( + getDaughterRegionInfo(e.getValue(), HConstants.SPLITA_QUALIFIER).getEncodedName()); + parentNotCleaned.add( + getDaughterRegionInfo(e.getValue(), HConstants.SPLITB_QUALIFIER).getEncodedName()); } } if (cleaned != 0) { Index: hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java (revision 1374478) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java (working copy) @@ -542,6 +542,7 @@ final Map splitParents = new TreeMap(new SplitParentFirstComparator()); splitParents.put(parent, makeResultFromHRegionInfo(parent, splita, splitb)); + splita.setOffline(true); //simulate that splita goes offline when it is split splitParents.put(splita, makeResultFromHRegionInfo(splita, splitaa, splitab)); CatalogJanitor janitor = spy(new CatalogJanitor(server, services));