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

ddl: make local sort generate only one subtask for each instance #50925

Merged
merged 4 commits into from Feb 5, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Feb 2, 2024

What problem does this PR solve?

Issue Number: ref #48795

Problem Summary:

Previously, the subtask count is unreasonable:

// Make subtask large enough to reduce the overhead of local/global flush.
avgTasksPerDisk := int(int64(variable.DDLDiskQuota.Load()) / int64(config.SplitRegionSize))
regionBatch = min(avgTasksPerDisk, avgTasksPerInstance)

It is inaccurate to use 96M to calculate the size of index data in a region. As a result, the number of subtasks will become very large, which is quite inefficient.

What changed and how does it work?

Make local sort generate only one subtask for each instance.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    1.194TiB table, 8 worker count:
    Before this PR: 1 hour 1 min 29 sec
    image
    After this PR: 26 min 10 sec
    image
  • No need to test
    • I checked and no code files have been changed.

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 ti-chi-bot bot added release-note-none size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 2, 2024
Copy link

tiprow bot commented Feb 2, 2024

Hi @tangenta. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 2, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

Merging #50925 (1b278bf) into master (9aabf72) will increase coverage by 2.1319%.
Report is 20 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #50925        +/-   ##
================================================
+ Coverage   70.5281%   72.6600%   +2.1319%     
================================================
  Files          1466       1466                
  Lines        434112     437986      +3874     
================================================
+ Hits         306171     318241     +12070     
+ Misses       108699      99707      -8992     
- Partials      19242      20038       +796     
Flag Coverage Δ
integration 49.0020% <100.0000%> (?)
unit 70.3055% <100.0000%> (-0.0345%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 54.1120% <ø> (ø)
parser ∅ <ø> (∅)
br 51.0174% <ø> (+5.2488%) ⬆️

@tangenta
Copy link
Contributor Author

tangenta commented Feb 4, 2024

/retest

Copy link

tiprow bot commented Feb 4, 2024

@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

Copy link

ti-chi-bot bot commented Feb 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wjhuang2016, zimulala

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

The pull request process is described here

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

Copy link

ti-chi-bot bot commented Feb 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-02 07:08:00.364432174 +0000 UTC m=+1722121.928729879: ☑️ agreed by zimulala.
  • 2024-02-05 06:17:36.568690306 +0000 UTC m=+164782.135460197: ☑️ agreed by wjhuang2016.

@ti-chi-bot ti-chi-bot bot merged commit 613d999 into pingcap:master Feb 5, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants