Index: src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java (revision 1572430) +++ src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java (working copy) @@ -513,24 +513,16 @@ @Override public int reseekTo(byte[] key, int offset, int length) throws IOException { - int compared; if (isSeeked()) { - compared = compareKey(reader.getComparator(), key, offset, length); - if (compared < 1) { - // If the required key is less than or equal to current key, then - // don't do anything. - return compared; - } else { - if (this.nextIndexedKey != null && - (this.nextIndexedKey == HConstants.NO_NEXT_INDEXED_KEY || - reader.getComparator().compare(key, offset, length, - nextIndexedKey, 0, nextIndexedKey.length) < 0)) { - // The reader shall continue to scan the current data block instead of querying the - // block index as long as it knows the target key is strictly smaller than - // the next indexed key or the current data block is the last data block. - return loadBlockAndSeekToKey(this.block, this.nextIndexedKey, - false, key, offset, length, false); - } + if (this.nextIndexedKey != null && + (this.nextIndexedKey == HConstants.NO_NEXT_INDEXED_KEY || + reader.getComparator().compare(key, offset, length, + nextIndexedKey, 0, nextIndexedKey.length) < 0)) { + // The reader shall continue to scan the current data block instead of querying the + // block index as long as it knows the target key is strictly smaller than + // the next indexed key or the current data block is the last data block. + return loadBlockAndSeekToKey(this.block, this.nextIndexedKey, + false, key, offset, length, false); } } // Don't rewind on a reseek operation, because reseek implies that we are