feat(memory): expose module memory statistics - #1350
Open
wangyunlai-seekdb wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces allocator-level memory reporting with fixed module-level statistics exposed through V$OB_MEMORY.
Changes:
- Adds memory getters and 12 module statistics.
- Redefines the virtual table/view schema.
- Updates dependent tests and golden results.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/obtest/t/storage/slog_checkpoint_restart.test |
Removes obsolete memory-label check. |
tools/obtest/t/sql/group_concat_memory_eatup.test |
Removes allocator-label accounting check. |
tools/obtest/t/sql/count_distinct_memory_eatup.test |
Removes allocator-label accounting checks. |
tools/obtest/t/quick/minor_freeze_and_restart.test |
Removes obsolete restart check. |
tools/obtest/t/quick/include/restart_cluster.inc |
Removes obsolete shared restart check. |
tools/obtest/t/join/nestloop_join_occupy_too_much_memory.test |
Removes label-based memory checks. |
tools/obtest/r/storage/slog_checkpoint_restart.result |
Updates expected restart output. |
tools/obtest/r/sql/group_concat_memory_eatup.result |
Updates expected SQL output. |
tools/obtest/r/sql/count_distinct_memory_eatup.result |
Updates expected SQL output. |
tools/obtest/r/quick/minor_freeze_and_restart.result |
Updates expected restart output. |
tools/obtest/r/quick/basic_function_standalone.result |
Updates included restart output. |
tools/obtest/r/quick/basic_function_lite.result |
Updates included restart output. |
tools/obtest/r/join/nestloop_join_occupy_too_much_memory.result |
Removes obsolete memory results. |
tools/obtest/r/join/explain_bug.result |
Updates virtual-table metadata. |
tools/deploy/mysql_test/test_suite/inner_table/r/mysql/show_sys_tables_in_sys.result |
Updates inner-table schema golden. |
tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result |
Updates system-view description. |
tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result |
Updates MySQL view description. |
tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql_when_compare_sensitive.result |
Updates case-sensitive golden. |
src/storage/tmp_file/ob_tmp_file_write_buffer_pool.h |
Declares TMP_FILE memory getter. |
src/storage/tmp_file/ob_tmp_file_write_buffer_pool.cpp |
Implements TMP_FILE statistics. |
src/storage/allocator/ob_shared_memory_allocator_mgr.h |
Declares shared allocator getters. |
src/storage/allocator/ob_shared_memory_allocator_mgr.cpp |
Implements TX_DATA, MDS, and VECTOR statistics. |
src/sql/plan_cache/ob_ps_cache.h |
Declares PS cache memory getter. |
src/sql/plan_cache/ob_ps_cache.cpp |
Implements PS cache statistics. |
src/sql/dtl/ob_dtl_fc_server.h |
Declares DTL memory getter. |
src/sql/dtl/ob_dtl_fc_server.cpp |
Implements DTL statistics. |
src/share/inner_table/ob_inner_table_schema_def.py |
Redefines the table and view schema. |
src/observer/virtual_table/ob_all_virtual_memory_info.h |
Defines the new module-row interface. |
src/observer/virtual_table/ob_all_virtual_memory_info.cpp |
Collects and exposes the 12 module rows. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
__all_virtual_memory_infocontract with module-levelMOD_NAME,HOLD,USED, andMEM_LIMITstatisticsObSharedMemAllocMgr::get_vector_memory_info()so the virtual table follows the module's native accountingORDER BY HOLD DESCfromV$OB_MEMORYMigration notes
This PR migrates the product-code changes from internal GitLab MR !1115.
The GitHub repository does not contain the internal VOSTest files or the plan_cache/ps/px/time_zone mysqltest files changed by the source MR, so those deleted upstream-only test paths were not reintroduced here. Existing GitHub inner-table golden files were updated where applicable.
Validation
ob-make ob_serverCARGO_NET_OFFLINE=true ob-make seekdb