Skip to content

ReflectionQueryFactory test is flaky #1277

Open
@mightyguava

Description

@mightyguava

delete() - misk.hibernate.ReflectionQueryFactoryTest
https://circleci.com/gh/cashapp/misk/3867#tests/containers/1

misk.jdbc.TableScanException: Missing index on query:
/* delete DbMovie as generatedAlias0 where generatedAlias0.release_date<=:param0 */ select id from movies where release_date <= '1978-01-01' limit 10001 for update/* vtgate:: filtered_replication_unfriendly */
Plan is:
Explanation{id=1, select_type=SIMPLE, table=movies, type=ALL, rows=1, filtered=100.0, Extra=Using where}
	at misk.jdbc.VitessScaleSafetyChecks$TableScanDetector.afterQuery(VitessScaleSafetyChecks.kt:471)
	at misk.jdbc.ExtendedQueryExecutionListener.afterQuery(VitessScaleSafetyChecks.kt:305)
	at net.ttddyy.dsproxy.listener.ChainListener.afterQuery(ChainListener.java:27)
	at net.ttddyy.dsproxy.proxy.StatementProxyLogic.performQueryExecutionListener(StatementProxyLogic.java:387)
	at net.ttddyy.dsproxy.proxy.StatementProxyLogic.access$700(StatementProxyLogic.java:36)
	at net.ttddyy.dsproxy.proxy.StatementProxyLogic$1.execute(StatementProxyLogic.java:122)
	at net.ttddyy.dsproxy.listener.MethodExecutionListenerUtils.invoke(MethodExecutionListenerUtils.java:41)
	at net.ttddyy.dsproxy.proxy.StatementProxyLogic.invoke(StatementProxyLogic.java:119)
	at net.ttddyy.dsproxy.proxy.jdk.PreparedStatementInvocationHandler.invoke(PreparedStatementInvocationHandler.java:37)
	at com.sun.proxy.$Proxy77.executeUpdate(Unknown Source)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
	at org.hibernate.hql.internal.ast.exec.BasicExecutor.doExecute(BasicExecutor.java:100)
	at org.hibernate.hql.internal.ast.exec.BasicExecutor.execute(BasicExecutor.java:59)
	at org.hibernate.hql.internal.ast.exec.DeleteExecutor.execute(DeleteExecutor.java:109)
	at org.hibernate.hql.internal.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:454)
	at org.hibernate.engine.query.spi.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:382)
	at org.hibernate.internal.SessionImpl.executeUpdate(SessionImpl.java:1562)
	at org.hibernate.query.internal.AbstractProducedQuery.doExecuteUpdate(AbstractProducedQuery.java:1626)
	at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1608)
	at misk.hibernate.ReflectionQuery.delete(ReflectionQueryFactory.kt:83)
	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 misk.hibernate.ReflectionQuery.invoke(ReflectionQueryFactory.kt:169)
	at com.sun.proxy.$Proxy108.delete(Unknown Source)
	at misk.hibernate.ReflectionQueryFactoryTest$delete$deleted$1.invoke(ReflectionQueryFactoryTest.kt:499)
	at misk.hibernate.ReflectionQueryFactoryTest$delete$deleted$1.invoke(ReflectionQueryFactoryTest.kt:15)
	at misk.hibernate.RealTransacter$transactionInternalSession$1$1.invoke(RealTransacter.kt:206)
	at misk.hibernate.RealTransacter$RealSession.target$misk_hibernate(RealTransacter.kt:445)
	at misk.hibernate.RealTransacter$transactionInternalSession$1.invoke(RealTransacter.kt:201)
	at misk.hibernate.RealTransacter$transactionInternalSession$1.invoke(RealTransacter.kt:36)
	at misk.hibernate.RealTransacter.withSession(RealTransacter.kt:306)
	at misk.hibernate.RealTransacter.withSession$default(RealTransacter.kt:288)
	at misk.hibernate.RealTransacter.transactionInternalSession(RealTransacter.kt:200)
	at misk.hibernate.RealTransacter.access$transactionInternalSession(RealTransacter.kt:36)
	at misk.hibernate.RealTransacter$transaction$1$1$1.invoke(RealTransacter.kt:113)
	at misk.hibernate.RealTransacter$maybeWithTracing$1.invoke(RealTransacter.kt:570)
	at misk.hibernate.RealTransacter$maybeWithTracing$1.invoke(RealTransacter.kt:36)
	at misk.tracing.TracerExtKt.traceWithSpan(TracerExt.kt:24)
	at misk.tracing.TracerExtKt.traceWithSpan$default(TracerExt.kt:14)
	at misk.hibernate.RealTransacter.maybeWithTracing(RealTransacter.kt:568)
	at misk.hibernate.RealTransacter.access$maybeWithTracing(RealTransacter.kt:36)
	at misk.hibernate.RealTransacter$transaction$1$1.invoke(RealTransacter.kt:113)
	at misk.hibernate.RealTransacter.transactionWithRetriesInternal(RealTransacter.kt:155)
	at misk.hibernate.RealTransacter.access$transactionWithRetriesInternal(RealTransacter.kt:36)
	at misk.hibernate.RealTransacter$transaction$1.invoke(RealTransacter.kt:112)
	at misk.hibernate.RealTransacter$maybeWithTracing$1.invoke(RealTransacter.kt:570)
	at misk.hibernate.RealTransacter$maybeWithTracing$1.invoke(RealTransacter.kt:36)
	at misk.tracing.TracerExtKt.traceWithSpan(TracerExt.kt:24)
	at misk.tracing.TracerExtKt.traceWithSpan$default(TracerExt.kt:14)
	at misk.hibernate.RealTransacter.maybeWithTracing(RealTransacter.kt:568)
	at misk.hibernate.RealTransacter.transaction(RealTransacter.kt:111)
	at misk.hibernate.ReflectionQueryFactoryTest.delete(ReflectionQueryFactoryTest.kt:495)
	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.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:515)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:171)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:167)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:114)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:59)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:105)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:110)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:110)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
	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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
	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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.base/java.lang.Thread.run(Thread.java:834)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    hibernateHibernate & application-layer database access

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions