@Test
  public void testSplitAfterRefresh() throws Exception {
    Admin admin = util.getAdmin();
    table = util.createTable(TEST_TABLE, TEST_FAMILY);

    try {
      // Create Multiple store files
      Put puta = new Put(ROW_A);
      puta.addColumn(TEST_FAMILY, qualifierCol1, bytes1);
      table.put(puta);
      admin.flush(TEST_TABLE);

      Put putb = new Put(ROW_B);
      putb.addColumn(TEST_FAMILY, qualifierCol1, bytes2);
      table.put(putb);
      admin.flush(TEST_TABLE);

      Put putc = new Put(ROW_C);
      putc.addColumn(TEST_FAMILY, qualifierCol1, bytes3);
      table.put(putc);
      admin.flush(TEST_TABLE);

      admin.compact(TEST_TABLE);
      while (admin.getCompactionState(TEST_TABLE) != CompactionState.NONE) {
        Thread.sleep(1000);
      }
      table.put(putb);
      HRegion hr1 = (HRegion) util.getRSForFirstRegionInTable(TEST_TABLE)
        .getRegionByEncodedName(admin.getRegions(TEST_TABLE).get(0).getEncodedName());
      // Refresh store files post compaction, this should not open already compacted files
      hr1.refreshStoreFiles(true);
      int numRegionsBeforeSplit = admin.getRegions(TEST_TABLE).size();
      // Check if we can successfully split after compaction
      admin.splitRegionAsync(admin.getRegions(TEST_TABLE).get(0).getEncodedNameAsBytes(), ROW_C)
        .get();
      util.waitFor(20000, new Waiter.Predicate<Exception>() {
        @Override
        public boolean evaluate() throws Exception {
          int numRegionsAfterSplit = 0;
          List<RegionServerThread> rst = util.getMiniHBaseCluster().getLiveRegionServerThreads();
          for (RegionServerThread t : rst) {
            numRegionsAfterSplit += t.getRegionServer().getRegions(TEST_TABLE).size();
          }
          // Make sure that the split went through and all the regions are assigned
          return (numRegionsAfterSplit == numRegionsBeforeSplit + 1
            && admin.isTableAvailable(TEST_TABLE));
        }
      });
      // Split at this point should not result in the RS being aborted
      assertEquals(3, util.getMiniHBaseCluster().getLiveRegionServerThreads().size());
    } finally {
      if (admin != null) {
        admin.close();
      }
    }
  }
This class tests the scenario where a store refresh happens due to a file not found during scan,
after a compaction but before the compacted files are archived. At this state we test for a split
and compaction
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java