-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Double close on shuffle during field loading #130838
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 all commits
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 |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
import org.elasticsearch.common.bytes.BytesReference; | ||
import org.elasticsearch.common.lucene.Lucene; | ||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.common.unit.ByteSizeValue; | ||
import org.elasticsearch.compute.data.Block; | ||
import org.elasticsearch.compute.data.BlockFactory; | ||
import org.elasticsearch.compute.data.BooleanBlock; | ||
|
@@ -446,12 +445,6 @@ protected void assertSimpleOutput(List<Page> input, List<Page> results) { | |
assertThat(sum, equalTo(expectedSum)); | ||
} | ||
|
||
@Override | ||
protected ByteSizeValue enoughMemoryForSimple() { | ||
assumeFalse("strange exception in the test, fix soon", true); | ||
return ByteSizeValue.ofKb(1); | ||
} | ||
|
||
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. This test didn't catch any failures, but it would have if we'd made a non-"simple" version. I'll expand this in a followup I think. |
||
public void testLoadAll() { | ||
DriverContext driverContext = driverContext(); | ||
loadSimpleAndAssert( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,10 +98,16 @@ protected ByteSizeValue enoughMemoryForSimple() { | |
* all pages. | ||
*/ | ||
public final void testSimpleCircuitBreaking() { | ||
ByteSizeValue memoryLimitForSimple = enoughMemoryForSimple(); | ||
Operator.OperatorFactory simple = simple(new SimpleOptions(true)); | ||
/* | ||
* Build the input before building `simple` to handle the rare | ||
* cases where `simple` need some state from the input - mostly | ||
* this is ValuesSourceReaderOperator. | ||
*/ | ||
DriverContext inputFactoryContext = driverContext(); | ||
List<Page> input = CannedSourceOperator.collectPages(simpleInput(inputFactoryContext.blockFactory(), between(1_000, 10_000))); | ||
|
||
ByteSizeValue memoryLimitForSimple = enoughMemoryForSimple(); | ||
Operator.OperatorFactory simple = simple(new SimpleOptions(true)); | ||
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. This shift fixed the test. |
||
try { | ||
ByteSizeValue limit = BreakerTestUtil.findBreakerLimit(memoryLimitForSimple, l -> runWithLimit(simple, input, l)); | ||
ByteSizeValue testWithSize = ByteSizeValue.ofBytes(randomLongBetween(0, limit.getBytes())); | ||
|
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.
Here's the bug - you can't use the
target
array and then shuffle into it.