[Enhancement] Extend 'show usage resource groups;' with mem_pool metrics (backport #66690) #67412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I'm doing:
The
mem_poolproperty for resource groups was recently introduced. See related pull requests below:Currently, there is no way to display the usage metrics of the memory pools.
What I'm doing:
This pull request extends the result of
show usage resource groups;command with the following:BEMemLimitBytes) under the same memory pool to the same value. This value also corresponds to the memory limit of the memory pool (BEMemPoolMemLimitBytes). The displayed values in these two columns will coincide due to this restriction, but it might change in the future.BEMemPoolInUseMemBytesis the sum of memory usages of each resource group that belongs to that memory pool. See the screenshots below for an example scenario.Notes/Discussion
group_versionaTResourceGroupUsageobject belongs to. I tried two different approaches:resorce_group_usage_recorder.cpp, I added an auxillaryVersionedResourceGroupUsagestruct which had a group_version and aTResourceGroupUsageobject as a pair. This solution worked, but it is just too messy for something as simple as this. See b9c4141group_versionfield to theResourceUsage.thriftfile and directly use it. This is much cleaner. See bba2165group_versionis only used byresorce_group_usage_recorder.cppin the backend, and is not read from the thrift file on the front end side.Demo
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
Note
Enhances resource group usage reporting with memory‑pool metrics end-to-end.
SHOW USAGE RESOURCE GROUPSwithBEMemLimitBytes,BEMemPool,BEMemPoolInUseMemBytes,BEMemPoolMemLimitBytes; updates metadata, rendering, and testsResourceGroupUsageRecordernow includesgroup_version,mem_limit_bytes,mem_pool, and mem‑pool limit/usage; merges per‑group stats preferring latestgroup_versionWorkGroupexposes parent memory limit/usage helpers used for mem‑pool valuesComputeNode.ResourceGroupUsageextended to carry new fields and map from thriftTResourceGroupUsagefor mem limits/pool andgroup_versionWritten by Cursor Bugbot for commit a07cc5e. This will update automatically on new commits. Configure here.
This is an automatic backport of pull request #66690 done by [Mergify](https://mergify.com).