Skip to content

Commit 9968e29

Browse files
authored
Advance ords when tryReadAHead and there is only one term. (elastic#141576)
Closes elastic#141529
1 parent daa2ba3 commit 9968e29

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

muted-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ tests:
327327
- class: org.elasticsearch.search.query.VectorIT
328328
method: testFilteredQueryStrategy
329329
issue: https://github.com/elastic/elasticsearch/issues/141469
330-
- class: org.elasticsearch.index.codec.tsdb.es819.ES819TSDBDocValuesFormatTests
331-
method: testOptionalColumnAtATimeReader
332-
issue: https://github.com/elastic/elasticsearch/issues/141529
330+
- class: org.elasticsearch.xpack.security.authc.TokenServiceTests
331+
method: testAttachAndGetToken
332+
issue: https://github.com/elastic/elasticsearch/issues/141470
333333
- class: org.elasticsearch.indices.recovery.IndexRecoveryIT
334334
method: testSourceThrottling
335335
issue: https://github.com/elastic/elasticsearch/issues/141548

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,8 @@ public BlockLoader.Block tryRead(
984984
BlockLoader.Block tryReadAHead(BlockLoader.BlockFactory factory, BlockLoader.Docs docs, int offset) throws IOException {
985985
if (ords instanceof BaseDenseNumericValues denseOrds) {
986986
if (entry.termsDictEntry.termsDictSize == 1) {
987+
int lastDoc = docs.get(docs.count() - 1);
988+
denseOrds.advanceExact(lastDoc);
987989
return factory.constantBytes(BytesRef.deepCopyOf(lookupOrd(0)), docs.count() - offset);
988990
}
989991
if (valuesSorted == false) {

0 commit comments

Comments
 (0)