@Test
  public void testKrfCreatedAfterRestart() throws InterruptedException, IOException {
    LocalRegion region = (LocalRegion) createRegion();

    putEntries(region, 0, 5, "A");
    putEntries(region, 0, 1, "B");
    invalidateEntries(region, 1, 2);
    removeEntries(region, 2, 3);

    // this ensures we don't get a chance to create a krf
    // but instead recover from the crf
    backupDisk();
    cache.close();
    restoreDisk();

    cache = createCache();

    // no go ahead and recover
    region = (LocalRegion) createRegion();

    putEntries(region, 5, 10, "A");
    DiskStoreImpl store =
        (DiskStoreImpl) cache.findDiskStore(region.getAttributes().getDiskStoreName());
    // Create a new oplog, to make sure we still create a krf for the old oplog.
    store.forceRoll();
    putEntries(region, 10, 15, "A");

    PersistentOplogSet set = store.getPersistentOplogSet(region.getDiskRegion());
    String currentChild = set.getChild().getOplogFileForTest().getName();
    // Wait for the krfs to be created
    Set<String> crfs;
    Set<String> krfs;
    long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(10);
    do {
      crfs = new HashSet<>();
      krfs = new HashSet<>();
      getCrfsAndKrfs(crfs, krfs);
      // Remove the current child because it does not have a krf
      crfs.remove(currentChild.split("\\.")[0]);
    } while (!crfs.equals(krfs) && System.nanoTime() < end);

    // Make sure all of the crfs have krfs
    assertEquals("KRFS were not created within 30 seconds", crfs, krfs);

    cache.close();

    crfs = new HashSet<>();
    krfs = new HashSet<>();
    getCrfsAndKrfs(crfs, krfs);
    assertEquals("last krf was not created on cache close", crfs, krfs);
  }
Test to make sure that we create missing krfs when we restart the system.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionAsyncRecoveryJUnitTest.java