-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
ESQL: Track memory from values loaded from lucene #101383
ESQL: Track memory from values loaded from lucene #101383
Conversation
This adds memory tracking for values loaded from doc values and stored fields.
Hi @nik9000, I've created a changelog YAML for you. |
Pinging @elastic/es-ql (Team:QL) |
Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL) |
…ues' into esql_memory_on_values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to push an extra change here - I'll flip the tests from defaulting to an untracked BlockFactory to a tracked one. We want all tests to use a tracked one in soon enough, so let's get the default right.
|
||
@Override | ||
public void close() { | ||
// TODO assert that we close the test blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look at this one now.
growValuesArray(newSize); | ||
adjustBreaker(-valuesLength * elementSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change while trying to reenable one of the HeapAttack tests - specifically the too many mv fields one. It didn't get it passing, which is genuinely odd to me. Either way, I think it is more correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ this is more correct as we create a new array of newSize
before copying.
@@ -161,6 +161,7 @@ public static Block[] fromList(BlockFactory blockFactory, List<List<Object>> lis | |||
public static Block deepCopyOf(Block block, BlockFactory blockFactory) { | |||
try (Block.Builder builder = block.elementType().newBlockBuilder(block.getPositionCount(), blockFactory)) { | |||
builder.copyFrom(block, 0, block.getPositionCount()); | |||
builder.mvOrdering(block.mvOrdering()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was required to get some tests working. It meant I had to make the method a noop on unsupported block types but that seems ok.
} | ||
} | ||
} | ||
// for (Page p : results) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woop.s Let me get this back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
growValuesArray(newSize); | ||
adjustBreaker(-valuesLength * elementSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ this is more correct as we create a new array of newSize
before copying.
It just started failing. Let's suppress it in this PR.
This adds memory tracking for values loaded from doc values and stored fields.