starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

[BugFix] set ExecTimeout for ANALYZE (backport #66361)

Open mergify[bot] opened this issue 2 weeks ago โ€ข 5 comments

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 return Config.statistic_collect_query_timeout for ANALYZE statements.
    • Add brief docs on timeout selection for SELECT/DML/ANALYZE in method comment.
  • Config:
    • Clarify statistic_collect_query_timeout docs (units=seconds; total job timeout semantics).
  • Tests:
    • Add StmtExecutorTest.testExecTimeout asserting timeouts for SELECT, ANALYZE, and CTAS.

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).

mergify[bot] avatar Dec 12 '25 09:12 mergify[bot]

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] avatar Dec 12 '25 09:12 mergify[bot]

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

mergify[bot] avatar Dec 12 '25 09:12 mergify[bot]

๐Ÿงช CI Insights

Here's what we observed from your CI run for f458783b.

๐ŸŸข All jobs passed!

But CI Insights is watching ๐Ÿ‘€

mergify[bot] avatar Dec 12 '25 09:12 mergify[bot]

@Mergifyio backport branch-3.4 branch-3.3

murphyatwork avatar Dec 12 '25 10:12 murphyatwork

backport branch-3.4 branch-3.3

โœ… Backports have been created

mergify[bot] avatar Dec 12 '25 10:12 mergify[bot]

@cursor review

alvin-celerdata avatar Dec 12 '25 17:12 alvin-celerdata

@Mergifyio rebase

murphyatwork avatar Dec 16 '25 08:12 murphyatwork

rebase

โœ… Branch has been successfully rebased

mergify[bot] avatar Dec 16 '25 08:12 mergify[bot]