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

*: add memory tracker for mppIterator (#40901) #40990

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #40901

What problem does this PR solve?

Issue Number: close #40900
Problem Summary:

What is changed and how it works?

Track the memory usage of mppIterator

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
mysql> set tidb_mem_quota_query = 1 <<30;
mysql> desc analyze  select * from `sli-gauge-metric`  order by cluster_id;
+----------------------------+------------+---------+--------------+------------------------+----------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------+-------------
---------------------+----------+---------+
| id                         | estRows    | actRows | task         | access object          | execution info                                                       
                                                                                                                                                                   
                                                                                                                                                     | operator inf
o                    | memory   | disk    |
+----------------------------+------------+---------+--------------+------------------------+----------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------+-------------
---------------------+----------+---------+
| Sort_4                     | 1151072.00 | 1031072 | root         |                        | time:1m47.8s, loops:1008                                             
                                                                                                                                                                   
                                                                                                                                                     | test.sli-gau
ge-metric.cluster_id | 1.12 GB  | 7.39 GB |
| └─TableReader_14       | 1151072.00 | 1031072 | root         |                        | time:42.5s, loops:1018, cop_task: {num: 28, max: 0s, min: 0s, avg: 0s, p9
5: 0s, copr_cache_hit_ratio: 0.00}                                                                                                                                 
                                                                                                                                                 | data:ExchangeSen
der_13           | 485.7 MB | N/A     |
|   └─ExchangeSender_13  | 1151072.00 | 1031072 | mpp[tiflash] |                        | tiflash_task:{proc max:5.71s, min:2.24s, avg: 3.97s, p80:5.71s, p95:5.71s
, iters:26, tasks:2, threads:21}                                                                                                                                   
                                                                                                                                                 | ExchangeType: Pa
ssThrough        | N/A      | N/A     |
|     └─TableFullScan_12 | 1151072.00 | 1031072 | mpp[tiflash] | table:sli-gauge-metric | tiflash_task:{proc max:1.84s, min:660.7ms, avg: 1.25s, p80:1.84s, p95:1.$4s, iters:26, tasks:2, threads:21}, tiflash_scan:{dtfile:{total_scanned_packs:147, total_skipped_packs:46, total_scanned_rows:1035088, total_skipped_rows:373766, $otal_rs_index_load_time: 0ms, total_read_time: 24748ms}, total_create_snapshot_time: 0ms, total_local_region_num: 0, total_remote_region_num: 0} | keep order:fals$                 | N/A      | N/A     |
+----------------------------+------------+---------+--------------+------------------------+---------------------------------------------------------------------$------------------------------------------------------------------------------------------------------------------------------------------------------------------$-----------------------------------------------------------------------------------------------------------------------------------------------------+------------$---------------------+----------+---------+
4 rows in set (1 min 49.58 sec)

mysql> set tidb_mem_quota_query = 500 << 20;
mysql> desc analyze  select * from `sli-gauge-metric`  order by cluster_id;
ERROR 1105 (HY000): Out Of Memory Quota![conn_id=7037804604603498899]

mysql> set tidb_mem_quota_query = 1 << 40;
mysql> desc analyze  select * from `sli-gauge-metric`  order by cluster_id;
+----------------------------+------------+---------+--------------+------------------------+----------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------+----------------
------------------+----------+---------+
| id                         | estRows    | actRows | task         | access object          | execution info                                                       
                                                                                                                                                                   
                                                                                                                                                  | operator info  
                  | memory   | disk    |
+----------------------------+------------+---------+--------------+------------------------+----------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------+----------------
------------------+----------+---------+
| Sort_4                     | 1151072.00 | 1031072 | root         |                        | time:1m3.6s, loops:1008                                              
                                                                                                                                                                   
                                                                                                                                                  | test.sli-gauge-
metric.cluster_id | 7.47 GB  | 0 Bytes |
| └─TableReader_14       | 1151072.00 | 1031072 | root         |                        | time:59.3s, loops:1016, cop_task: {num: 23, max: 0s, min: 0s, avg: 0s, p9
5: 0s, copr_cache_hit_ratio: 0.00}                                                                                                                                 
                                                                                                                                              | data:ExchangeSender
_13           | 488.6 MB | N/A     |
|   └─ExchangeSender_13  | 1151072.00 | 1031072 | mpp[tiflash] |                        | tiflash_task:{proc max:7.25s, min:2.23s, avg: 4.74s, p80:7.25s, p95:7.25s
, iters:21, tasks:2, threads:16}                                                                                                                                   
                                                                                                                                              | ExchangeType: PassT
hrough        | N/A      | N/A     |
|     └─TableFullScan_12 | 1151072.00 | 1031072 | mpp[tiflash] | table:sli-gauge-metric | tiflash_task:{proc max:1.61s, min:656.1ms, avg: 1.13s, p80:1.61s, p95:1.6
1s, iters:21, tasks:2, threads:16}, tiflash_scan:{dtfile:{total_scanned_packs:147, total_skipped_packs:1, total_scanned_rows:1035088, total_skipped_rows:7681, tota
l_rs_index_load_time: 0ms, total_read_time: 22349ms}, total_create_snapshot_time: 0ms, total_local_region_num: 0, total_remote_region_num: 0} | keep order:false   
              | N/A      | N/A     |
+----------------------------+------------+---------+--------------+------------------------+----------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------+----------------
------------------+----------+---------+
4 rows in set (1 min 3.57 sec)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link
Member Author

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. labels Feb 2, 2023
@ti-chi-bot
Copy link
Member Author

@ti-chi-bot: This cherry pick PR is for a release branch and has not yet been approved by release team.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick, it must first be approved by the collaborators.

AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. labels Feb 2, 2023
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 2, 2023
@ti-chi-bot
Copy link
Member Author

@ti-chi-bot: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/build 1e1832f link true /test build
idc-jenkins-ci-tidb/unit-test 1e1832f link true /test unit-test
idc-jenkins-ci-tidb/check_dev_2 1e1832f link true /test check-dev2
idc-jenkins-ci-tidb/check_dev 1e1832f link true /test check-dev
idc-jenkins-ci-tidb/mysql-test 1e1832f link true /test mysql-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@wshwsh12 wshwsh12 closed this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants