Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Optimize memory tracker (backport #49841) #50694

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 4, 2024

Why I'm doing:

Currently, memory statistics consume a lot of performance because they are all calculated each time.

What I'm doing:

Get some samples to estimate the manager's memory, even though it is inaccurate, but it's helpful to solve memory leak bugs.

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
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

Documentation PRs only:

If you are submitting a PR that adds or changes English documentation and have not
included Chinese documentation, then you can check the box to request GPT to translate the
English doc to Chinese. Please ensure to uncheck the Do not translate box if translation is needed.
The workflow will generate a new PR with the Chinese translation after this PR is merged.

  • Yes, translate English markdown files with GPT
  • Do not translate

This is an automatic backport of pull request #49841 done by [Mergify](https://mergify.com). ## Why I'm doing: Currently, memory statistics consume a lot of performance because they are all calculated each time.

What I'm doing:

Get some samples to estimate the manager's memory, even though it is inaccurate, but it's helpful to solve memory leak bugs.

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

## Why I'm doing:
Currently, memory statistics consume a lot of performance because they are all calculated each time.

## What I'm doing:
Get some samples to estimate the manager's memory, even though it is inaccurate, but it's helpful to solve memory leak bugs.

Signed-off-by: gengjun-git <[email protected]>
(cherry picked from commit f0cb5e9)

# Conflicts:
#	contrib/destination-starrocks/src/main/java/io/airbyte/integrations/destination/starrocks/StreamLoader.java
#	fe/fe-core/src/main/java/com/starrocks/catalog/Database.java
#	fe/fe-core/src/main/java/com/starrocks/common/util/ProfileManager.java
#	fe/fe-core/src/main/java/com/starrocks/connector/CatalogConnector.java
#	fe/fe-core/src/main/java/com/starrocks/connector/Connector.java
#	fe/fe-core/src/main/java/com/starrocks/connector/delta/CachingDeltaLakeMetastore.java
#	fe/fe-core/src/main/java/com/starrocks/connector/delta/DeltaLakeMetastore.java
#	fe/fe-core/src/main/java/com/starrocks/connector/iceberg/CachingIcebergCatalog.java
#	fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergCatalog.java
#	fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergConnector.java
#	fe/fe-core/src/main/java/com/starrocks/connector/jdbc/JDBCTableIdCache.java
#	fe/fe-core/src/main/java/com/starrocks/lake/compaction/CompactionMgr.java
#	fe/fe-core/src/main/java/com/starrocks/leader/ReportHandler.java
#	fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobMgr.java
#	fe/fe-core/src/main/java/com/starrocks/memory/InternalCatalogMemoryTracker.java
#	fe/fe-core/src/main/java/com/starrocks/memory/MemoryTrackable.java
#	fe/fe-core/src/main/java/com/starrocks/memory/MemoryUsageTracker.java
#	fe/fe-core/src/main/java/com/starrocks/qe/QeProcessorImpl.java
#	fe/fe-core/src/main/java/com/starrocks/scheduler/TaskManager.java
#	fe/fe-core/src/main/java/com/starrocks/scheduler/TaskRunManager.java
#	fe/fe-core/src/main/java/com/starrocks/scheduler/history/TaskRunHistory.java
#	fe/fe-core/src/main/java/com/starrocks/transaction/GlobalTransactionMgr.java
#	fe/fe-core/src/main/java/com/starrocks/warehouse/WarehouseClusterProcNode.java
#	fe/fe-core/src/test/java/com/starrocks/connector/delta/CachingDeltaLakeMetastoreTest.java
#	fe/fe-core/src/test/java/com/starrocks/connector/delta/DeltaLakeConnectorTest.java
@mergify mergify bot added the conflicts label Sep 4, 2024
Copy link
Contributor Author

mergify bot commented Sep 4, 2024

Cherry-pick of f0cb5e9 has failed:

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

You are currently cherry-picking commit f0cb5e97c8.
  (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/backup/BackupHandler.java
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/OlapTable.java
	modified:   fe/fe-core/src/main/java/com/starrocks/catalog/TabletInvertedIndex.java
	modified:   fe/fe-core/src/main/java/com/starrocks/common/Config.java
	modified:   fe/fe-core/src/main/java/com/starrocks/connector/LazyConnector.java
	modified:   fe/fe-core/src/main/java/com/starrocks/connector/delta/DeltaLakeConnector.java
	modified:   fe/fe-core/src/main/java/com/starrocks/connector/elasticsearch/ElasticsearchConnector.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/DeleteMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/ExportMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/loadv2/LoadMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/routineload/RoutineLoadMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/load/streamload/StreamLoadMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/qe/QueryDetailQueue.java
	modified:   fe/fe-core/src/main/java/com/starrocks/server/LocalMetastore.java
	modified:   fe/fe-core/src/main/java/com/starrocks/sql/optimizer/statistics/CacheDictManager.java
	modified:   fe/fe-core/src/main/java/com/starrocks/task/AgentTaskQueue.java
	modified:   fe/fe-core/src/main/java/com/starrocks/transaction/DatabaseTransactionMgr.java
	modified:   fe/fe-core/src/main/java/com/starrocks/transaction/TxnStateCallbackFactory.java

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   contrib/destination-starrocks/src/main/java/io/airbyte/integrations/destination/starrocks/StreamLoader.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/catalog/Database.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/common/util/ProfileManager.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/CatalogConnector.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/Connector.java
	deleted by us:   fe/fe-core/src/main/java/com/starrocks/connector/delta/CachingDeltaLakeMetastore.java
	deleted by us:   fe/fe-core/src/main/java/com/starrocks/connector/delta/DeltaLakeMetastore.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/iceberg/CachingIcebergCatalog.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergCatalog.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergConnector.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/jdbc/JDBCTableIdCache.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/lake/compaction/CompactionMgr.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/leader/ReportHandler.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobMgr.java
	deleted by them: fe/fe-core/src/main/java/com/starrocks/memory/InternalCatalogMemoryTracker.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/memory/MemoryTrackable.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/memory/MemoryUsageTracker.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/qe/QeProcessorImpl.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/scheduler/TaskManager.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/scheduler/TaskRunManager.java
	deleted by us:   fe/fe-core/src/main/java/com/starrocks/scheduler/history/TaskRunHistory.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/transaction/GlobalTransactionMgr.java
	both modified:   fe/fe-core/src/main/java/com/starrocks/warehouse/WarehouseClusterProcNode.java
	deleted by us:   fe/fe-core/src/test/java/com/starrocks/connector/delta/CachingDeltaLakeMetastoreTest.java
	deleted by us:   fe/fe-core/src/test/java/com/starrocks/connector/delta/DeltaLakeConnectorTest.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

@mergify mergify bot mentioned this pull request Sep 4, 2024
26 tasks
@mergify mergify bot closed this Sep 4, 2024
Copy link
Contributor Author

mergify bot commented Sep 4, 2024

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

@mergify mergify bot deleted the mergify/bp/branch-3.2/pr-49841 branch September 4, 2024 13:04
@gengjun-git gengjun-git restored the mergify/bp/branch-3.2/pr-49841 branch September 5, 2024 07:46
Signed-off-by: gengjun-git <[email protected]>
@gengjun-git gengjun-git reopened this Sep 5, 2024
@wanpengfei-git wanpengfei-git enabled auto-merge (squash) September 5, 2024 08:48
Signed-off-by: gengjun-git <[email protected]>
Copy link

sonarcloud bot commented Sep 5, 2024

@andyziye andyziye merged commit 692bdf7 into branch-3.2 Sep 9, 2024
31 checks passed
@andyziye andyziye deleted the mergify/bp/branch-3.2/pr-49841 branch September 9, 2024 12:28
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