Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 1, 2025

Why I'm doing:

The current lazy refresh mechanism (refreshAfterWrite) of statistics cache causes unnecessary cluster resource waste:

  1. Redundant cache loading: When tables have many partitions, lazy refresh will reload all table content into FE cache, consuming significant cluster resources with the default thread pool size of 10

  2. Duplicate refresh logic: We already have background ANALYZE jobs that refresh the statistics cache, making the lazy refresh completely redundant

  3. Resource inefficiency: The combination of background ANALYZE + lazy refresh creates unnecessary concurrent pressure on the cluster

What I'm doing:

  • Add enable_statistic_cache_refresh_after_write config (default: false) to disable lazy refresh
  • Reduce statistic_cache_thread_pool_size from 10 to 5
  • Modify CachedStatisticStorage.createAsyncLoadingCache() to conditionally enable refreshAfterWrite

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

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

This is an automatic backport of pull request #62518 done by [Mergify](https://mergify.com).

…default (#62518)

(cherry picked from commit 62fd6e3)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/sql/optimizer/statistics/CachedStatisticStorage.java
Copy link
Contributor Author

mergify bot commented Sep 1, 2025

Cherry-pick of 62fd6e3 has failed:

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

You are currently cherry-picking commit 62fd6e3985.
  (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/sql/optimizer/statistics/CachedStatisticStorage.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 Sep 1, 2025

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

auto-merge was automatically disabled September 1, 2025 06:18

Pull request was closed

Copy link
Contributor Author

mergify bot commented Sep 1, 2025

🧪 CI Insights

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

🟢 All jobs passed!

But CI Insights is watching 👀

Signed-off-by: stephen <stephen5217@163.com>
@stephen-shelby stephen-shelby reopened this Sep 1, 2025
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) September 1, 2025 12:05
@wanpengfei-git wanpengfei-git merged commit 38b40fd into branch-3.3 Sep 2, 2025
53 of 55 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.3/pr-62518 branch September 2, 2025 12:02
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.

3 participants