@Test
  public void testEmptyWALEdit() throws IOException {
    final String region = "region__5";
    REGIONS.clear();
    REGIONS.add(region);
    makeRegionDirs(REGIONS);
    fs.mkdirs(WALDIR);
    Path path = new Path(WALDIR, WAL_FILE_PREFIX + 5);
    generateEmptyEditWAL(path, Bytes.toBytes(region));
    useDifferentDFSClient();

    Path regiondir = new Path(TABLEDIR, region);
    fs.mkdirs(regiondir);
    List<Path> splitPaths = WALSplitter.split(HBASELOGDIR, WALDIR, OLDLOGDIR, fs, conf, wals);
    // Make sure that WALSplitter generate the split file
    assertEquals(1, splitPaths.size());

    Path originalLog = (fs.listStatus(OLDLOGDIR))[0].getPath();
    assertEquals(11, countWAL(originalLog));
    // we will skip the empty WAL when splitting
    assertEquals(10, countWAL(splitPaths.get(0)));
  }
See HBASE-27644, typically we should not have empty WALEdit but we should be able to process
it, instead of losing data after it.
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestWALSplit.java