Skip to content

Process streams of partition tables one by one in MultiplexInputStream (#8507)#8520

Merged
ti-chi-bot[bot] merged 4 commits intopingcap:release-7.5from
ti-chi-bot:cherry-pick-8507-to-release-7.5
Dec 14, 2023
Merged

Process streams of partition tables one by one in MultiplexInputStream (#8507)#8520
ti-chi-bot[bot] merged 4 commits intopingcap:release-7.5from
ti-chi-bot:cherry-pick-8507-to-release-7.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #8507

What problem does this PR solve?

Issue Number: close #8505

Problem Summary:
See #8505.

What is changed and how it works?

In the previous code, many streams of different partition tables may be processed concurrently. This PR simply fixes it by processing streams of partition tables one by one.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

create a table with 36 partitions.
Test SQL select * from employees.

mysql> explain analyze select * from employees;
+-------------------------+--------------+-----------+--------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------+------+
| id                      | estRows      | actRows   | task         | access object   | execution info                                                                                                                                                                                                                                                                                                                                                                                                    | operator info                             | memory  | disk |
+-------------------------+--------------+-----------+--------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------+------+
| TableReader_11          | 436207616.00 | 603979776 | root         | partition:all   | time:13.4s, loops:590554, RU:0.000000, cop_task: {num: 10160, max: 0s, min: 0s, avg: 0s, p95: 0s, copr_cache_hit_ratio: 0.00}                                                                                                                                                                                                                                                                                     | MppVersion: 1, data:ExchangeSender_10     | 7.92 MB | N/A  |
| └─ExchangeSender_10     | 436207616.00 | 603979776 | mpp[tiflash] |                 | tiflash_task:{proc max:12.9s, min:12.6s, avg: 12.7s, p80:12.9s, p95:12.9s, iters:10283, tasks:2, threads:72}                                                                                                                                                                                                                                                                                                      | ExchangeType: PassThrough                 | N/A     | N/A  |
|   └─TableFullScan_9     | 436207616.00 | 603979776 | mpp[tiflash] | table:employees | tiflash_task:{proc max:137.4ms, min:121ms, avg: 129.2ms, p80:137.4ms, p95:137.4ms, iters:10283, tasks:2, threads:72}, tiflash_scan:{dtfile:{total_scanned_packs:94981, total_skipped_packs:15416, total_scanned_rows:774644749, total_skipped_rows:125859659, total_rs_index_load_time: 0ms, total_read_time: 35296ms}, total_create_snapshot_time: 3ms, total_local_region_num: 972, total_remote_region_num: 0} | keep order:false, PartitionTableScan:true | N/A     | N/A  |
+-------------------------+--------------+-----------+--------------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------+------+
3 rows in set (13.45 sec)
image

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

Fix potential OOM when scanning many partition tables with stream model.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels Dec 14, 2023
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Dec 14, 2023
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 14, 2023
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 14, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gengliqi, SeaRise

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 14, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 14, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-14 09:40:55.007157177 +0000 UTC m=+521946.044384102: ☑️ agreed by gengliqi.
  • 2023-12-14 09:45:01.739942118 +0000 UTC m=+522192.777169030: ☑️ agreed by SeaRise.

@gengliqi
Copy link
Contributor

/run-all-tests

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 14, 2023

@ti-chi-bot: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

trigger some heavy tests which will not run always when PR updated.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Details

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 ti-community-infra/tichi repository.

@gengliqi
Copy link
Contributor

/run-unit-test

@ti-chi-bot ti-chi-bot bot merged commit f68e662 into pingcap:release-7.5 Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants