Skip to content

Commit f76f177

Browse files
committed
Fix bug in compressed binary doc values bulk decoding.
Reuse firstBlockId as blockId on first iteration.
1 parent b4d23a9 commit f76f177

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ void decodeBulk(int numBlocks, int firstDoc, int count, BlockLoader.SingletonByt
617617
byte[] bytes = new byte[bufferSize];
618618

619619
while (remainingCount > 0) {
620-
long blockId = findAndUpdateBlockByScanning(nextDoc);
620+
long blockId = remainingCount == count ? firstBlockId : findAndUpdateBlockByScanning(nextDoc);
621621
int numDocsInBlock = (int) (limitDocNumForBlock - startDocNumForBlock);
622622
int idxFirstDocInBlock = (int) (nextDoc - startDocNumForBlock);
623623
int countInBlock = Math.min(numDocsInBlock - idxFirstDocInBlock, remainingCount);

0 commit comments

Comments
 (0)