-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Split large pages on load sometimes #131053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
c96f5b5
50f632f
f24df78
735ea24
b1aebd5
fcfb421
b58082a
5186b88
60b3314
ae089f8
c82eaa0
c2f656d
00e6c3b
dd3e9c4
eaabdee
4fed32c
9641518
36c35a4
74114a8
68d45d9
53b4bdc
fb0249a
1dcb020
a81d427
77ff429
9a7613f
aa7c608
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 131053 | ||
summary: Split large pages on load sometimes | ||
area: ES|QL | ||
type: bug | ||
issues: [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,10 +124,10 @@ private static class SingletonLongs extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.LongBuilder builder = factory.longsFromDocValues(docs.count())) { | ||
int lastDoc = -1; | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < lastDoc) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -173,9 +173,9 @@ private static class Longs extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.LongBuilder builder = factory.longsFromDocValues(docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < this.docID) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -259,10 +259,10 @@ private static class SingletonInts extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.IntBuilder builder = factory.intsFromDocValues(docs.count())) { | ||
int lastDoc = -1; | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < lastDoc) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -308,9 +308,9 @@ private static class Ints extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.IntBuilder builder = factory.intsFromDocValues(docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < this.docID) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -408,10 +408,10 @@ private static class SingletonDoubles extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.DoubleBuilder builder = factory.doublesFromDocValues(docs.count())) { | ||
int lastDoc = -1; | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < lastDoc) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -461,9 +461,9 @@ private static class Doubles extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.DoubleBuilder builder = factory.doublesFromDocValues(docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < this.docID) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -544,10 +544,10 @@ private static class DenseVectorValuesBlockReader extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
// Doubles from doc values ensures that the values are in order | ||
try (BlockLoader.FloatBuilder builder = factory.denseVectors(docs.count(), dimensions)) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can we also minus the offset in the previous line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah. Let me figure out why that didn't get caught by the tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't a BlockLoaderTestCase for dense vectors. I think that's a "for later" problem. |
||
int doc = docs.get(i); | ||
if (doc < iterator.docID()) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -652,12 +652,12 @@ private BlockLoader.Block readSingleDoc(BlockFactory factory, int docId) throws | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
if (docs.count() == 1) { | ||
return readSingleDoc(factory, docs.get(0)); | ||
} | ||
try (BlockLoader.SingletonOrdinalsBuilder builder = factory.singletonOrdinalsBuilder(ordinals, docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
nik9000 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
int doc = docs.get(i); | ||
if (doc < ordinals.docID()) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -700,9 +700,9 @@ private static class Ordinals extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BytesRefBuilder builder = factory.bytesRefsFromDocValues(docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < ordinals.docID()) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -780,9 +780,9 @@ private static class BytesRefsFromBinary extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.BytesRefBuilder builder = factory.bytesRefs(docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < docID) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -879,9 +879,9 @@ private static class DenseVectorFromBinary extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.FloatBuilder builder = factory.denseVectors(docs.count(), dimensions)) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < docID) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -963,10 +963,10 @@ private static class SingletonBooleans extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.BooleanBuilder builder = factory.booleansFromDocValues(docs.count())) { | ||
int lastDoc = -1; | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < lastDoc) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
@@ -1012,9 +1012,9 @@ private static class Booleans extends BlockDocValuesReader { | |
} | ||
|
||
@Override | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
try (BlockLoader.BooleanBuilder builder = factory.booleansFromDocValues(docs.count())) { | ||
for (int i = 0; i < docs.count(); i++) { | ||
for (int i = offset; i < docs.count(); i++) { | ||
int doc = docs.get(i); | ||
if (doc < this.docID) { | ||
throw new IllegalStateException("docs within same block must be in order"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ interface ColumnAtATimeReader extends Reader { | |
/** | ||
* Reads the values of all documents in {@code docs}. | ||
*/ | ||
BlockLoader.Block read(BlockFactory factory, Docs docs) throws IOException; | ||
BlockLoader.Block read(BlockFactory factory, Docs docs, int offset) throws IOException; | ||
} | ||
|
||
interface RowStrideReader extends Reader { | ||
|
@@ -149,7 +149,7 @@ public String toString() { | |
*/ | ||
class ConstantNullsReader implements AllReader { | ||
@Override | ||
public Block read(BlockFactory factory, Docs docs) throws IOException { | ||
public Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
return factory.constantNulls(); | ||
|
||
} | ||
|
||
|
@@ -183,7 +183,7 @@ public Builder builder(BlockFactory factory, int expectedCount) { | |
public ColumnAtATimeReader columnAtATimeReader(LeafReaderContext context) { | ||
return new ColumnAtATimeReader() { | ||
@Override | ||
public Block read(BlockFactory factory, Docs docs) { | ||
public Block read(BlockFactory factory, Docs docs, int offset) { | ||
return factory.constantBytes(value); | ||
} | ||
|
||
|
@@ -261,8 +261,8 @@ public ColumnAtATimeReader columnAtATimeReader(LeafReaderContext context) throws | |
} | ||
return new ColumnAtATimeReader() { | ||
@Override | ||
public Block read(BlockFactory factory, Docs docs) throws IOException { | ||
return reader.read(factory, docs); | ||
public Block read(BlockFactory factory, Docs docs, int offset) throws IOException { | ||
return reader.read(factory, docs, offset); | ||
} | ||
|
||
@Override | ||
|
Uh oh!
There was an error while loading. Please reload this page.