@Test
  public void testClientScannerIsResetWhenScanThrowsIOException()
    throws IOException, InterruptedException {
    reset();
    THROW_ONCE.set(true); // throw exceptions only once
    TableName tableName = TableName.valueOf(name.getMethodName());
    try (Table t = TEST_UTIL.createTable(tableName, FAMILY)) {
      int rowCount = TEST_UTIL.loadTable(t, FAMILY, false);
      TEST_UTIL.getAdmin().flush(tableName);
      inject();
      int actualRowCount = TEST_UTIL.countRows(t, new Scan().addColumn(FAMILY, FAMILY));
      assertEquals(rowCount, actualRowCount);
    }
    assertTrue(REQ_COUNT.get() > 0);
  }
Tests the case where a Scan can throw an IOException in the middle of the seek / reseek leaving
the server side RegionScanner to be in dirty state. The client has to ensure that the
ClientScanner does not get an exception and also sees all the data.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideScanExcpetion.java