[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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: dynamically adjusting the max write speed of reorganization job #57611

Merged
merged 44 commits into from
Nov 25, 2024

Conversation

fzzf678
Copy link
Contributor
@fzzf678 fzzf678 commented Nov 21, 2024

What problem does this PR solve?

Issue Number: ref #57526 #57229

Problem Summary: See #57229

What changed and how does it work?

Supply later

Check List

Tests

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

Use sysbench prepare table with 50000000 rows, create index and tune the max_write_speed and check the TiKV IO panel import. To see the result clearly, set the initial @@global.tidb_ddl_reorg_max_write_speed = '5MiB'

sysbench --db-driver=mysql --mysql-db=test --report-interval=10 --mysql-user=root  --mysql-password=''  --time=0 --mysql-port=4000 --mysql-host=127.0.0.1 --tables=1 --table-size=50000000 --threads=1 oltp_read_write prepare

Add index in session 1.

alter table sbtest1 drop index(k);

Alter the max_write_speed in session 2.

admin alter ddl jobs 115 max_write_speed = '20MiB';  -- 5MiB, 20MiB, 10MiB, 0

And check the grafana panel, the config can works
img_v3_02gu_294ea1d6-dd32-4c49-8f53-11c8049399fg

  • 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 Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 21, 2024
Copy link
tiprow bot commented Nov 21, 2024

Hi @fzzf678. 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-sigs/prow repository.

@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 21, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Nov 21, 2024
@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 21, 2024

/test all

Copy link
codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 78.00000% with 33 lines in your changes missing coverage. Please review.

Project coverage is 74.7128%. Comparing base (06c6e40) to head (48f1831).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #57611        +/-   ##
================================================
+ Coverage   72.8668%   74.7128%   +1.8459%     
================================================
  Files          1677       1722        +45     
  Lines        463842     472018      +8176     
================================================
+ Hits         337987     352658     +14671     
+ Misses       104975      97183      -7792     
- Partials      20880      22177      +1297     
Flag Coverage Δ
integration 49.2567% <33.3333%> (?)
unit 72.2088% <77.3333%> (-0.0642%) ⬇️

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

Components Coverage Δ
dumpling 52.7673% <ø> (ø)
parser ∅ <ø> (∅)
br 61.0633% <ø> (+15.5490%) ⬆️
---- 🚨 Try these New Features:

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 22, 2024
@@ -75,8 +75,9 @@ type DDLReorgMeta struct {
// These two variables are used to control the concurrency and batch size of the reorganization process.
// They can be adjusted dynamically through `admin alter ddl jobs` command.
// Note: Don't get or set these two variables directly, use the functions instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make these 3 var private

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will try make these vars private in next PR

Copy link
Member
@CbcWestwolf CbcWestwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

pkg/meta/model/reorg.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 22, 2024
Copy link
ti-chi-bot bot commented Nov 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-22 06:03:08.187779729 +0000 UTC m=+184375.807434246: ☑️ agreed by winoros.
  • 2024-11-22 06:33:40.782162927 +0000 UTC m=+186208.401817441: ☑️ agreed by CbcWestwolf.

Co-authored-by: CbcWestwolf <1004626265@qq.com>
@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 22, 2024

/cc @lance6716, please help take a look

pkg/ddl/db_test.go Outdated Show resolved Hide resolved
@pingcap pingcap deleted a comment from ti-chi-bot bot Nov 25, 2024
@pingcap pingcap deleted a comment from tiprow bot Nov 25, 2024
Copy link
Contributor
@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest lgtm

/hold

free to unhold

pkg/planner/core/planbuilder.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved labels Nov 25, 2024
Copy link
ti-chi-bot bot commented Nov 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CbcWestwolf, D3Hunter, lance6716, winoros

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

@D3Hunter
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 25, 2024
@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 25, 2024

/retest

2 similar comments
@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 25, 2024

/retest

@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 25, 2024

/retest

@fzzf678
Copy link
Contributor Author
fzzf678 commented Nov 25, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit ec8b81b into pingcap:master Nov 25, 2024
27 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #57690.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants