@Test
  public void testWALMonotonicallyIncreasingSeqId() throws Exception {
    List<Thread> putThreads = new ArrayList<>();
    for (int i = 0; i < 1; i++) {
      putThreads.add(new PutThread(region));
    }
    IncThread incThread = new IncThread(region);
    for (int i = 0; i < 1; i++) {
      putThreads.get(i).start();
    }
    incThread.start();
    incThread.join();

    Path logPath = ((AbstractFSWAL<?>) region.getWAL()).getCurrentFileName();
    region.getWAL().rollWriter();
    Thread.sleep(10);
    Path hbaseDir = new Path(walConf.get(HConstants.HBASE_DIR));
    Path oldWalsDir = new Path(hbaseDir, HConstants.HREGION_OLDLOGDIR_NAME);
    try (WALStreamReader reader = createReader(logPath, oldWalsDir)) {
      long currentMaxSeqid = 0;
      for (WAL.Entry e; (e = reader.next()) != null;) {
        if (!WALEdit.isMetaEditFamily(e.getEdit().getCells().get(0))) {
          long currentSeqid = e.getKey().getSequenceId();
          if (currentSeqid > currentMaxSeqid) {
            currentMaxSeqid = currentSeqid;
          } else {
            fail("Current max Seqid is " + currentMaxSeqid
              + ", but the next seqid in wal is smaller:" + currentSeqid);
          }
        }
      }
    }
  }
Test for HBASE-17471.
<p>
MVCCPreAssign is added by HBASE-16698, but pre-assign mvcc is only used in put/delete path. Other
write paths like increment/append still assign mvcc in ringbuffer's consumer thread. If put and
increment are used parallel. Then seqid in WAL may not increase monotonically Disorder in wals
will lead to data loss.
<p>
This case use two thread to put and increment at the same time in a single region. Then check the
seqid in WAL. If seqid is wal is not monotonically increasing, this case will fail
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWALMonotonicallyIncreasingSeqId.java