Skip to content
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

Flaky test TestMemoryConnectorTest.testCustomMetricsScanFilter #8793

Closed
electrum opened this issue Aug 4, 2021 · 6 comments
Closed

Flaky test TestMemoryConnectorTest.testCustomMetricsScanFilter #8793

electrum opened this issue Aug 4, 2021 · 6 comments

Comments

@electrum
Copy link
Member

electrum commented Aug 4, 2021

https://github.com/trinodb/trino/pull/8771/checks?check_run_id=3235051688

[ERROR] Tests run: 239, Failures: 1, Errors: 0, Skipped: 28, Time elapsed: 196.537 s <<< FAILURE! - in TestSuite
[ERROR] testCustomMetricsScanFilter(io.trino.plugin.memory.TestMemoryConnectorTest)  Time elapsed: 0.126 s  <<< FAILURE!
org.junit.ComparisonFailure: expected:<LongCount{total=[2000]}> but was:<LongCount{total=[1665]}>
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at io.trino.plugin.memory.TestMemoryConnectorTest.testCustomMetricsScanFilter(TestMemoryConnectorTest.java:154)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
@electrum electrum changed the title Flaky test testCustomMetricsScanFilter(io.trino.plugin.memory.TestMemoryConnectorTest) Flaky test TestMemoryConnectorTest.testCustomMetricsScanFilter Aug 4, 2021
@electrum
Copy link
Member Author

electrum commented Aug 4, 2021

There are lots of these:

2021-08-03T16:56:08.059-0500 WARNING Error while inspecting age of task 20210803_215606_00009_9gh9k.1.0
java.lang.IllegalArgumentException: Expected operatorType to be PagesIndexBuilderOperator but was PageBufferOperator
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:443)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:489)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:438)
	at io.trino.operator.PipelineContext.getPipelineStats(PipelineContext.java:413)
	at com.google.common.collect.Iterators$6.transform(Iterators.java:783)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
	at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:467)
	at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:854)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:276)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:233)
	at io.trino.operator.TaskContext.getTaskStats(TaskContext.java:428)
	at io.trino.execution.SqlTask.getTaskStats(SqlTask.java:353)
	at io.trino.execution.SqlTask.createTaskInfo(SqlTask.java:375)
	at io.trino.execution.SqlTask.getTaskInfo(SqlTask.java:237)
	at io.trino.execution.SqlTaskManager.failAbandonedTasks(SqlTaskManager.java:495)
	at io.trino.execution.SqlTaskManager.lambda$start$4(SqlTaskManager.java:240)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

2021-08-03T16:56:08.262-0500 WARNING Error removing old tasks
java.lang.IllegalArgumentException: Expected operatorType to be PagesIndexBuilderOperator but was PageBufferOperator
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:443)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:489)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:438)
	at io.trino.operator.PipelineContext.getPipelineStats(PipelineContext.java:413)
	at com.google.common.collect.Iterators$6.transform(Iterators.java:783)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
	at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:467)
	at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:854)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:276)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:233)
	at io.trino.operator.TaskContext.getTaskStats(TaskContext.java:428)
	at io.trino.execution.SqlTask.getTaskStats(SqlTask.java:353)
	at io.trino.execution.SqlTask.createTaskInfo(SqlTask.java:375)
	at io.trino.execution.SqlTask.getTaskInfo(SqlTask.java:237)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at io.trino.execution.SqlTaskManager.removeOldTasks(SqlTaskManager.java:475)
	at io.trino.execution.SqlTaskManager.lambda$start$4(SqlTaskManager.java:234)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

@electrum
Copy link
Member Author

electrum commented Aug 4, 2021

cc @rzeyde-varada

@rzeyde-varada
Copy link
Contributor

The flakiness seems to be the same as reported in #8691 (comment)

@rzeyde-varada
Copy link
Contributor

rzeyde-varada commented Aug 5, 2021

Not sure about #8793 (comment) - seems that it happens also in other builds:
https://github.com/trinodb/trino/runs/3245125396?check_suite_focus=true#step:5:28308
https://github.com/trinodb/trino/runs/3244066755?check_suite_focus=true#step:5:21475
https://github.com/trinodb/trino/runs/3160717555?check_suite_focus=true#step:5:21402

IIUC, this error happens during trino-thrift integration tests (e.g. TestThriftDistributedQueriesIndexed).

@rzeyde-varada
Copy link
Contributor

rzeyde-varada commented Aug 5, 2021

Reproduced locally with TestThriftDistributedQueriesIndexed#testHighCardinalityIndexJoinResult on Trino 359:

2021-08-05T02:45:57.143-0500 WARNING Error removing old tasks
java.lang.IllegalArgumentException: Expected operatorType to be PagesIndexBuilderOperator but was PageBufferOperator
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:443)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:478)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:428)
	at io.trino.operator.PipelineContext.getPipelineStats(PipelineContext.java:413)
	at com.google.common.collect.Iterators$6.transform(Iterators.java:783)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
	at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:467)
	at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:854)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:276)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:233)
	at io.trino.operator.TaskContext.getTaskStats(TaskContext.java:417)
	at io.trino.execution.SqlTask.getTaskStats(SqlTask.java:350)
	at io.trino.execution.SqlTask.createTaskInfo(SqlTask.java:372)
	at io.trino.execution.SqlTask.getTaskInfo(SqlTask.java:234)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at io.trino.execution.SqlTaskManager.removeOldTasks(SqlTaskManager.java:458)
	at io.trino.execution.SqlTaskManager.lambda$start$4(SqlTaskManager.java:231)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

2021-08-05T02:45:57.148-0500 WARNING Error while inspecting age of task 20210805_074554_00000_zqndc.1.0
java.lang.IllegalArgumentException: Expected operatorType to be PagesIndexBuilderOperator but was PageBufferOperator
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:443)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:478)
	at io.trino.operator.OperatorStats.add(OperatorStats.java:428)
	at io.trino.operator.PipelineContext.getPipelineStats(PipelineContext.java:413)
	at com.google.common.collect.Iterators$6.transform(Iterators.java:783)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
	at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:467)
	at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:854)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:276)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:233)
	at io.trino.operator.TaskContext.getTaskStats(TaskContext.java:417)
	at io.trino.execution.SqlTask.getTaskStats(SqlTask.java:350)
	at io.trino.execution.SqlTask.createTaskInfo(SqlTask.java:372)
	at io.trino.execution.SqlTask.getTaskInfo(SqlTask.java:234)
	at io.trino.execution.SqlTaskManager.failAbandonedTasks(SqlTaskManager.java:478)
	at io.trino.execution.SqlTaskManager.lambda$start$4(SqlTaskManager.java:237)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

<snip>

2021-08-05T02:45:57.797-0500 INFO TIMELINE: Query 20210805_074554_00000_zqndc :: Transaction:[ea7509f0-870e-4525-b27f-aeba8b5e88e8] :: elapsed 3030ms :: planning 658ms :: waiting 229ms :: scheduling 986ms :: running 508ms :: finishing 878ms :: begin 2021-08-05T02:45:54.516-05:00 :: end 2021-08-05T02:45:57.546-05:00
2021-08-05T02:45:58.414-0500 INFO FINISHED in Trino: 3.84s, H2: 285.70ms, total: 4.13s

I am not very familiar with the relevant code, but IIUC, it seems that IndexBuildDriverFactoryProvider allow creation of different operator factory types by using createSnapshot (which uses PagesIndexBuilderOperatorFactory) and createStreaming (which uses PageBufferOperatorFactory):

public DriverFactory createSnapshot(int pipelineId, IndexSnapshotBuilder indexSnapshotBuilder)
{
checkArgument(indexSnapshotBuilder.getOutputTypes().equals(outputTypes));
return new DriverFactory(
pipelineId,
inputDriver,
false,
ImmutableList.<OperatorFactory>builder()
.addAll(coreOperatorFactories)
.add(new PagesIndexBuilderOperatorFactory(outputOperatorId, planNodeId, indexSnapshotBuilder))
.build(),
OptionalInt.empty(),
UNGROUPED_EXECUTION);
}
public DriverFactory createStreaming(PageBuffer pageBuffer, Page indexKeyTuple)
{
ImmutableList.Builder<OperatorFactory> operatorFactories = ImmutableList.<OperatorFactory>builder()
.addAll(coreOperatorFactories);
if (dynamicTupleFilterFactory.isPresent()) {
// Bind in a dynamic tuple filter if necessary
operatorFactories.add(dynamicTupleFilterFactory.get().filterWithTuple(indexKeyTuple));
}
operatorFactories.add(new PageBufferOperatorFactory(outputOperatorId, planNodeId, pageBuffer));
return new DriverFactory(pipelineId, inputDriver, false, operatorFactories.build(), OptionalInt.empty(), UNGROUPED_EXECUTION);
}

@findepi
Copy link
Member

findepi commented Aug 5, 2021

closing in favor of #8691

@findepi findepi closed this as completed Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants