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

[Enhancement] run auto analyze job with priority (backport #55446) #55457

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 26, 2025

Why I'm doing:

In case of a database with 10K+ tables, the auto analyze job can sustain for a few hours, so the job will not stop even if out of the running window.

What I'm doing:

To address this issue, we introduce two optimizations:

  1. Check the running window before analyze each table
  2. Sort jobs with priority, considering the stats healthy and stats staleness

Out of scope:

  1. Analyzing external tables do not support priority
  2. If analyze a single table can take a long time, it cannot be interrupted immediately

Fixes #55447

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

@mergify mergify bot added the conflicts label Jan 26, 2025
Copy link
Contributor Author

mergify bot commented Jan 26, 2025

Cherry-pick of 4f8f233 has failed:

On branch mergify/bp/branch-3.4/pr-55446
Your branch is up to date with 'origin/branch-3.4'.

You are currently cherry-picking commit 4f8f2334e.
  (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/statistic/ExternalAnalyzeJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/statistic/NativeAnalyzeJob.java
	modified:   fe/fe-core/src/main/java/com/starrocks/statistic/StatisticAutoCollector.java
	modified:   fe/fe-core/src/main/java/com/starrocks/statistic/StatisticsCollectJob.java

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/statistic/StatisticsCollectJobFactory.java
	both modified:   fe/fe-core/src/test/java/com/starrocks/statistic/StatisticsCollectJobTest.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

Copy link
Contributor Author

mergify bot commented Jan 26, 2025

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

@mergify mergify bot closed this Jan 26, 2025
@murphyatwork murphyatwork reopened this Jan 26, 2025
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) January 26, 2025 09:36
Signed-off-by: Murphy <[email protected]>
(cherry picked from commit 4f8f233)
Signed-off-by: Murphy <[email protected]>

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/statistic/StatisticsCollectJobFactory.java
#	fe/fe-core/src/test/java/com/starrocks/statistic/StatisticsCollectJobTest.java
@murphyatwork murphyatwork force-pushed the mergify/bp/branch-3.4/pr-55446 branch from 1779626 to d380cb9 Compare January 26, 2025 09:38
@wanpengfei-git wanpengfei-git merged commit 9705fc4 into branch-3.4 Jan 27, 2025
29 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.4/pr-55446 branch January 27, 2025 02:12
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