@Override
          public boolean progress() {
            replayedEdits++;
            // during replay, rsAccounting should align with global memstore, because
            // there is only one memstore here
            Assert.assertEquals(rsAccounting.getGlobalMemStoreDataSize(),
              region.getMemStoreDataSize());
            Assert.assertEquals(rsAccounting.getGlobalMemStoreHeapSize(),
              region.getMemStoreHeapSize());
            Assert.assertEquals(rsAccounting.getGlobalMemStoreOffHeapSize(),
              region.getMemStoreOffHeapSize());
            // abort the replay before finishing, leaving some edits in the memory
            return replayedEdits < totalEdits - 10;
          }
HBASE-21031 If replay edits fails, we need to make sure memstore is rollbacked And if MSLAB is
used, all chunk is released too.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEditsReplayAndAbort.java