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

[BugFix] Add exhausted check for MultiJoinBinder (backport #54917) #54934

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 10, 2025

Why I'm doing:

MultiJoinBinder may hold lock too long time:

;lockHoldTime: 447230 ms;dump thread: starrocks-mysql-nio-pool-53, id: 367
    app//com.google.common.collect.RegularImmutableSet.contains(RegularImmutableSet.java:64)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.isMultiJoinOp(Binder.java:258)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.isMultiJoinRecursive(Binder.java:271)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.isMultiJoinRecursive(Binder.java:277)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.isMultiJoin(Binder.java:262)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.match(Binder.java:186)
    app//com.starrocks.sql.optimizer.rule.Binder.match(Binder.java:109)
    app//com.starrocks.sql.optimizer.rule.Binder.next(Binder.java:96)
    app//com.starrocks.sql.optimizer.task.ApplyRuleTask.execute(ApplyRuleTask.java:103)
    app//com.starrocks.sql.optimizer.task.SeriallyTaskScheduler.executeTasks(SeriallyTaskScheduler.java:65)
    app//com.starrocks.sql.optimizer.Optimizer.memoOptimize(Optimizer.java:754)
    app//com.starrocks.sql.optimizer.Optimizer.optimizeByCost(Optimizer.java:253)
    app//com.starrocks.sql.optimizer.Optimizer.optimize(Optimizer.java:177)
    app//com.starrocks.sql.StatementPlanner.createQueryPlan(StatementPlanner.java:256)
    app//com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:134)
    app//com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:96)
    app//com.starrocks.qe.StmtExecutor.execute(StmtExecutor.java:556)
    app//com.starrocks.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:347)
    app//com.starrocks.qe.ConnectProcessor.dispatch(ConnectProcessor.java:541)
    app//com.starrocks.qe.ConnectProcessor.processOnce(ConnectProcessor.java:853)
    app//com.starrocks.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:69)
    app//com.starrocks.mysql.nio.ReadListener$$Lambda$1620/0x00007f36a99fa440.run(Unknown Source)
    [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    [email protected]/java.lang.Thread.run(Thread.java:829)
;lockHoldTime: 432884 ms;dump thread: starrocks-mysql-nio-pool-54, id: 368
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.isMultiJoinRecursive(Binder.java:275)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.isMultiJoin(Binder.java:262)
    app//com.starrocks.sql.optimizer.rule.Binder$MultiJoinBinder.match(Binder.java:186)
    app//com.starrocks.sql.optimizer.rule.Binder.match(Binder.java:109)
    app//com.starrocks.sql.optimizer.rule.Binder.next(Binder.java:96)
    app//com.starrocks.sql.optimizer.task.ApplyRuleTask.execute(ApplyRuleTask.java:103)
    app//com.starrocks.sql.optimizer.task.SeriallyTaskScheduler.executeTasks(SeriallyTaskScheduler.java:65)
    app//com.starrocks.sql.optimizer.Optimizer.memoOptimize(Optimizer.java:754)
    app//com.starrocks.sql.optimizer.Optimizer.optimizeByCost(Optimizer.java:253)
    app//com.starrocks.sql.optimizer.Optimizer.optimize(Optimizer.java:177)
    app//com.starrocks.sql.StatementPlanner.createQueryPlan(StatementPlanner.java:256)
    app//com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:134)
    app//com.starrocks.sql.StatementPlanner.plan(StatementPlanner.java:96)
    app//com.starrocks.qe.StmtExecutor.execute(StmtExecutor.java:556)
    app//com.starrocks.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:347)
    app//com.starrocks.qe.ConnectProcessor.dispatch(ConnectProcessor.java:541)
    app//com.starrocks.qe.ConnectProcessor.processOnce(ConnectProcessor.java:853)
    app//com.starrocks.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:69)
    app//com.starrocks.mysql.nio.ReadListener$$Lambda$1620/0x00007f36a99fa440.run(Unknown Source)
    [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    [email protected]/java.lang.Thread.run(Thread.java:829)

What I'm doing:

  • Add a exhausted check policy in MultiJoinBinder;
  • Add more nested mv tests.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

LiShuMing
LiShuMing previously approved these changes Jan 10, 2025
@LiShuMing
Copy link
Contributor

@mergify rebase

Signed-off-by: shuming.li <[email protected]>
(cherry picked from commit 6d4f6c2)
Copy link
Contributor Author

mergify bot commented Jan 14, 2025

rebase

✅ Branch has been successfully rebased

@LiShuMing LiShuMing force-pushed the mergify/bp/branch-3.4/pr-54917 branch from 679b56f to c6ddd73 Compare January 14, 2025 05:31
Signed-off-by: shuming.li <[email protected]>
Copy link

@wanpengfei-git wanpengfei-git merged commit 75e5068 into branch-3.4 Jan 15, 2025
29 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.4/pr-54917 branch January 15, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants