StoreScanner in constructor calls StoreFileScanner::seek, which (after several levels of calls) is calling HFileBlock::readBlockDataInternal which reads block and pre-reads header of the next block.

This pre-readed header is stored in ThreadLocal<PrefetchedHeader> variable and stream is left in a position right behind the header of next block.

After constructor finished, scanner code does scanning, and, after pre-readed block data finished, it calls HFileReaderV2::readNextDataBlock, which again calls HFileBlock::readBlockDataInternal, but this call occured from different thread and there is nothing usefull in ThreadLocal variable

Due to this, stream is asked to seek backwards, and this cause duplicate DN request.

Do not take my closing of this issue as a discounting of the work done in here Max Lapan; rather, your work has been carried over into the duplicate and later in HBASE-17072. This issue is still a problem. You identified the useless seek. The threadlocal in turn is super problematic.

stack
added a comment - 18/Nov/16 22:28 Resolving as duplicated by HBASE-10676
Do not take my closing of this issue as a discounting of the work done in here Max Lapan ; rather, your work has been carried over into the duplicate and later in HBASE-17072 . This issue is still a problem. You identified the useless seek. The threadlocal in turn is super problematic.