@Test
  public void testMaxPreadBytesConfiguredToBeLessThanZero() throws Exception {
    Configuration conf = HBaseConfiguration.create();
    conf.set("hbase.hstore.engine.class", DummyStoreEngine.class.getName());
    // Set 'hbase.storescanner.pread.max.bytes' < 0, so that StoreScanner will be a STREAM type.
    conf.setLong(StoreScanner.STORESCANNER_PREAD_MAX_BYTES, -1);
    MyStore store = initMyStore(name.getMethodName(), conf, new MyStoreHook() {
    });
    Scan scan = new Scan();
    scan.addFamily(family);
    // ReadType on Scan is still DEFAULT only.
    assertEquals(ReadType.DEFAULT, scan.getReadType());
    StoreScanner storeScanner =
      (StoreScanner) store.getScanner(scan, scan.getFamilyMap().get(family), Long.MAX_VALUE);
    assertFalse(storeScanner.isScanUsePread());
  }
If there are two running InMemoryFlushRunnable, the later InMemoryFlushRunnable may change the
versionedList. And the first InMemoryFlushRunnable will use the chagned versionedList to remove
the corresponding segments. In short, there will be some segements which isn't in merge are
removed.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java