Skip to content

[BugFix] fix mem leak when caching mv plan context (backport #72300)#72389

Merged
wanpengfei-git merged 2 commits into
branch-3.5from
mergify/bp/branch-3.5/pr-72300
May 9, 2026
Merged

[BugFix] fix mem leak when caching mv plan context (backport #72300)#72389
wanpengfei-git merged 2 commits into
branch-3.5from
mergify/bp/branch-3.5/pr-72300

Conversation

@mergify

@mergify mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Why I'm doing:

There are lots of LakeTablet object on FOLLOWER after frequently drop&create same materialized view.
And objects can't be releazed after fe transfers to LEADER.

 num     #instances         #bytes  class name (module)
-------------------------------------------------------
   1:      24469095     1080226352  [B (java.base@17.0.2)
   2:      13197226     1055778080  com.starrocks.lake.LakeTablet

What I'm doing:

Removed dropped materialized view object from pending cache and double check materialized view still exists before be added to context cache.

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.

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 pr needs auto generate documentation
  • 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.1
    • 4.0
    • 3.5
    • 3.4

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

Signed-off-by: kaijian.ding <kaijian.ding@gmail.com>
(cherry picked from commit 33ccc4a)

# Conflicts:
#	fe/fe-core/src/test/java/com/starrocks/planner/MaterializedViewTextBasedRewriteTest.java
@mergify mergify Bot added the conflicts label Apr 30, 2026
@mergify

mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 33ccc4a has failed:

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

You are currently cherry-picking commit 33ccc4ae03.
  (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/sql/optimizer/CachingMvPlanContextBuilder.java

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

@wanpengfei-git wanpengfei-git enabled auto-merge (squash) April 30, 2026 06:06
@mergify mergify Bot closed this Apr 30, 2026
auto-merge was automatically disabled April 30, 2026 06:06

Pull request was closed

@mergify

mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

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

@kevincai kevincai reopened this May 8, 2026
@kevincai

kevincai commented May 8, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the backport conflict in single commit, don't edit pull request description.

Copilot AI commented May 8, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the backport conflict in single commit, don't edit pull request description.

Fixed in single amended commit c91a848e. I resolved the backport conflict in MaterializedViewTextBasedRewriteTest and left the PR description unchanged.

Signed-off-by: Kevin Cai <kevin.cai@celerdata.com>
@kevincai kevincai self-assigned this May 9, 2026
@wanpengfei-git wanpengfei-git merged commit 3e5fde1 into branch-3.5 May 9, 2026
29 of 30 checks passed
@wanpengfei-git wanpengfei-git deleted the mergify/bp/branch-3.5/pr-72300 branch May 9, 2026 02:19
@trueeyu

trueeyu commented May 11, 2026

Copy link
Copy Markdown
Contributor

@mergify backport branch-3.5-cc

@mergify

mergify Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

backport branch-3.5-cc

✅ Backports have been created

Details

wanpengfei-git pushed a commit that referenced this pull request May 12, 2026
…(backport #72389) (#73091)

Signed-off-by: Kevin Cai <kevin.cai@celerdata.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: kaijianding <kaijian.ding@gmail.com>
Co-authored-by: Kevin Cai <kevin.cai@celerdata.com>
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.

5 participants