Skip to content

Conversation

@martinr0x
Copy link
Contributor

@martinr0x martinr0x commented Nov 13, 2025

Why I'm doing:

See this PR

What I'm doing:

Adding a new class shared_mem_tracker_manager. This class manages shared_mem_tracker and will return the same mem tracker for the same mem_pool.

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

Note

Introduce a shared MemTracker per mem_pool and wire it into WorkGroup creation/initialization, adding a new tracker type, Thrift field, and tests.

  • WorkGroup / Manager:
    • Add mem_pool to WorkGroup (ctor, accessors) and accept parent mem tracker in init to support shared pools.
    • Create MemTrackerManager to return a shared parent MemTracker per mem_pool; integrate in WorkGroupManager::create_workgroup_unlocked.
    • Provide default DEFAULT_MEM_POOL and handle default vs custom pools.
  • Runtime / MemTracker:
    • Add MemTrackerType::RESOURCE_GROUP_SHARED_MEMORY_POOL and corresponding error message.
    • Expose GlobalEnv::query_pool_mem_tracker_shared().
  • Thrift:
    • Extend TWorkGroup with optional mem_pool.
  • Build & Tests:
    • Register new sources in CMake.
    • Add UTs for shared tracker behavior and manager integration; adjust existing tests to new WorkGroup ctor/init API.

Written by Cursor Bugbot for commit 9f41d21. This will update automatically on new commits. Configure here.

@mergify
Copy link
Contributor

mergify bot commented Nov 13, 2025

🧪 CI Insights

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

🟢 All jobs passed!

But CI Insights is watching 👀

@mergify
Copy link
Contributor

mergify bot commented Nov 13, 2025

🧪 CI Insights

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

❌ Job Failures

Pipeline Job Health on branch-4.0 Retries 🔍 CI Insights 📄 Logs
CI PIPELINE - BRANCH BE UT Unknown 0 View View

@murphyatwork
Copy link
Contributor

/root/starrocks/be/src/exec/workgroup/work_group.cpp:160:21: error: ‘const starrocks::_TWorkGroup__isset’ {aka ‘const struct starrocks::_TWorkGroup__isset’} has no member named ‘mem_pool’
  160 |     if (twg.__isset.mem_pool) {
      |                     ^~~~~~~~
/root/starrocks/be/src/exec/workgroup/work_group.cpp:161:25: error: ‘const class starrocks::TWorkGroup’ has no member named ‘mem_pool’
  161 |         _mem_pool = twg.mem_pool;
      |                         ^~~~~~~~
make[2]: *** [src/exec/CMakeFiles/Exec.dir/build.make:4122: src/exec/CMakeFiles/Exec.dir/workgroup/work_group.cpp.o] Error 1

@martinr0x

@martinr0x martinr0x force-pushed the mbogusz/use-mem-pool-be-4.0 branch from 9c62cf9 to 239b3b0 Compare November 14, 2025 08:29
@martinr0x martinr0x force-pushed the mbogusz/use-mem-pool-be-4.0 branch from 239b3b0 to 44ca836 Compare November 14, 2025 08:29
@murphyatwork murphyatwork enabled auto-merge (squash) November 14, 2025 09:37
@murphyatwork murphyatwork merged commit 53fe064 into StarRocks:branch-4.0 Nov 14, 2025
26 checks passed
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