[BugFix] set ExecTimeout for ANALYZE (backport #66361)
Why I'm doing:
The StmtExecutor::getExecTimeout impacts query execution and query forwarding (RPC timeout) and varies depending on the type of statement. The ANALYZE TABLE statement does not adhere to query_timeout, so this behavior should be accounted for in the function.
Without the fix, when executing ANALYZE TABLE on follower FE, the RPC timeout will be set to query_timeout, even if the statistic_collect_query_timeout is much longer than query_timeout.
What I'm doing:
Fixes #issue
What type of PR is this:
- [x] 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.
- [x] 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
- [x] This is a backport pr
Bugfix cherry-pick branch check:
- [x] I have checked the version labels which the pr will be auto-backported to the target branch
- [x] 4.0
- [x] 3.5
- [ ] 3.4
- [ ] 3.3
[!NOTE] Exec timeout for ANALYZE now uses
Config.statistic_collect_query_timeout; added unit tests and clarified config doc.
- QE/Execution:
- Update
StmtExecutor.getExecTimeout()to returnConfig.statistic_collect_query_timeoutforANALYZEstatements.- Add brief docs on timeout selection for SELECT/DML/ANALYZE in method comment.
- Config:
- Clarify
statistic_collect_query_timeoutdocs (units=seconds; total job timeout semantics).- Tests:
- Add
StmtExecutorTest.testExecTimeoutasserting timeouts forSELECT,ANALYZE, andCTAS.Written by Cursor Bugbot for commit 8dc5dd414a6f5f5ba0ac67a3bee4eaac9cea5e2b. This will update automatically on new commits. Configure here.
This is an automatic backport of pull request #66361 done by [Mergify](https://mergify.com).
Cherry-pick of 70b2f5e9548ef0b320786a556f4e15881ff89400 has failed:
On branch mergify/bp/branch-3.5/pr-66361
Your branch is up to date with 'origin/branch-3.5'.
You are currently cherry-picking commit 70b2f5e954.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: fe/fe-core/src/main/java/com/starrocks/common/Config.java
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java
both modified: fe/fe-core/src/test/java/com/starrocks/qe/StmtExecutorTest.java
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally
@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr
๐งช CI Insights
Here's what we observed from your CI run for f458783b.
๐ข All jobs passed!
But CI Insights is watching ๐
@Mergifyio backport branch-3.4 branch-3.3
backport branch-3.4 branch-3.3
โ Backports have been created
- #66785 [BugFix] set ExecTimeout for ANALYZE (backport #66361) (backport #66680) has been created for branch
branch-3.4but encountered conflicts - #66786 [BugFix] set ExecTimeout for ANALYZE (backport #66361) (backport #66680) has been created for branch
branch-3.3but encountered conflicts
@cursor review
@Mergifyio rebase
rebase