Slackbot
11/11/2022, 3:51 PMDidip Kerabat
11/11/2022, 3:54 PMLIKE queries. I random sampled N Historical pods and run jstack on them.
All of the processing threads are stuck and they all stuck the same way.
Either a groupBy:
"groupBy_JoinDataSource{left=problematic-table, right=InlineDataSource{signature={__time:LONG, d0:STRING, a0:LONG}}, rightPrefix='j0.', condition=(substring("problematic_column", 0, 3) == "j0.d0"), joinType=INNER, leftFilter=null}_[2022-09-26T00:00:00.000Z/2022-09-27T00:00:00.000Z]" #502 daemon prio=5 os_prio=0 cpu=684108891.95ms elapsed=1966818.51s tid=0x00007f17a0115c60 nid=612 runnable [0x00007e9b2e327000]
java.lang.Thread.State: RUNNABLE
at java.lang.StringLatin1.regionMatchesCI(java.base@18.0.2.1/StringLatin1.java:394)
at java.lang.String.regionMatches(java.base@18.0.2.1/String.java:2226)
at java.lang.String.equalsIgnoreCase(java.base@18.0.2.1/String.java:1962)
at java.lang.Boolean.parseBoolean(java.base@18.0.2.1/Boolean.java:149)
at org.apache.druid.math.expr.Evals.asBoolean(Evals.java:72)
at org.apache.druid.math.expr.ExprEval$StringExprEval.asBoolean(ExprEval.java:932)
at org.apache.druid.segment.filter.ExpressionFilter$2.matches(ExpressionFilter.java:208)
at org.apache.druid.segment.filter.NotFilter$1.matches(NotFilter.java:71)
at org.apache.druid.segment.filter.AndFilter$1.matches(AndFilter.java:205)
at org.apache.druid.segment.join.PostJoinCursor.advanceToMatch(PostJoinCursor.java:71)
at org.apache.druid.segment.join.PostJoinCursor.advanceUninterruptibly(PostJoinCursor.java:100)
at org.apache.druid.segment.join.PostJoinCursor.advance(PostJoinCursor.java:92)
or a topN:
"topN_problematic-table_[2022-06-18T00:00:00.000Z/2022-06-19T00:00:00.000Z]" #505 daemon prio=5 os_prio=0 cpu=24162945.76ms elapsed=1966818.48s tid=0x00007f17a008c420 nid=615 runnable [0x00007e9b2e023000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.getNode(java.base@18.0.2.1/HashMap.java:577)
at java.util.HashMap.get(java.base@18.0.2.1/HashMap.java:556)
at org.apache.druid.math.expr.InputBindings$6.get(InputBindings.java:144)
at org.apache.druid.math.expr.IdentifierExpr.eval(IdentifierExpr.java:131)
at org.apache.druid.math.expr.BinaryBooleanOpExprBase.eval(BinaryOperatorExpr.java:173)
at org.apache.druid.math.expr.BinOrExpr.eval(BinaryLogicalOperatorExpr.java:399)
at org.apache.druid.math.expr.BinOrExpr.eval(BinaryLogicalOperatorExpr.java:397)
at org.apache.druid.math.expr.BinOrExpr.eval(BinaryLogicalOperatorExpr.java:397)Didip Kerabat
11/11/2022, 3:55 PMDidip Kerabat
11/11/2022, 3:56 PMDidip Kerabat
11/11/2022, 3:58 PMDidip Kerabat
11/11/2022, 4:01 PMLIKE query running, our 5 minutes Broker timeout should have killed the query and the query should have been killed at Historical level as well, right?Didip Kerabat
11/11/2022, 6:22 PMDidip Kerabat
11/11/2022, 6:25 PMDidip Kerabat
11/11/2022, 6:31 PMLIKE queries are usually between 1 month to 1 quarter.Didip Kerabat
11/14/2022, 2:28 AMDruidProcessingModule , I don’t see that PrioritizedExecutorService inside getProcessingExecutorPool can be configured to be cancellable after X timeout.Didip Kerabat
11/14/2022, 2:36 AMPrioritizedExecutorService implement invokeAll so that any Runnable task can be killed after X timeout (and then have a global setting for timeout)?Didip Kerabat
11/14/2022, 3:00 AMawaitTermination method, but I don’t see where is it being called. But anyway, it looks like that’s for shutting down the entire pool.Didip Kerabat
11/14/2022, 3:08 AMqueryProcessingPool.submitRunnerTaskDidip Kerabat
11/14/2022, 3:13 AMQueryTimeoutException to stop.
and one way to set the timeout is via the context:
QueryContexts.hasTimeout(query) ?
future.get(QueryContexts.getTimeout(query), TimeUnit.MILLISECONDS) :
future.get()Didip Kerabat
11/14/2022, 3:16 AMQueryTimeoutException actually be raised?Laksh Singla
11/14/2022, 3:40 AMSo first question, is there a way to know what the topN is actually doing? I cannot tell which Boolean operation it does.Can you please share the topN query that is being run please. Also, I am not super familiar with jstack, however for the topN’s trace, should there be more lines (tracing back to Thread.run())?
Didip Kerabat
11/14/2022, 3:50 AMGian Merlino
11/15/2022, 6:21 AMGian Merlino
11/15/2022, 6:23 AMGian Merlino
11/15/2022, 6:23 AMGian Merlino
11/15/2022, 6:26 AMGian Merlino
11/15/2022, 6:27 AM