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: limit the count of getting ddlhistory jobs (#55590) #56142

Open
wants to merge 1 commit into
base: release-6.5
Choose a base branch
from

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #55590

What problem does this PR solve?

Issue Number: close #55711

Problem Summary:
If user want to get all of DDL-history jobs, the tidb-server has the risk of OOM because of large mount of DDL-history jobs.

What changed and how does it work?

  1. Limit the count of jobs when getting the ddl history jobs.
  2. The parameter 'limit' should be large than 1 and less than or equal to 1024.
  3. If use default 'limit', user can get the 1024 ddl history jobs by default.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Manual test steps

  1. create 5k table in database with the 'sysbench' tool.
  2. query the mount of ddl-history jobs, it contains 6052 ddl history jobs.
mysql> select count(*) from mysql.tidb_ddl_history;
+----------+
| count(*) |
+----------+
|     6052 |
+----------+
1 row in set (0.00 sec)
  1. run below command
curl -X POST http://172.16.6.95:11080/ddl/history

and the it gets the 1024 ddl history jobs by default.

  1. run below command, it gets the fault messages when limit < 0 or limit >= 1025
# curl -X POST http://172.16.6.95:11080/ddl/history -d "limit=0"
ddl history limit must be greater than 0 and less than or equal to 1024

# curl -X POST http://172.16.6.95:11080/ddl/history -d "limit=1025"
ddl history limit must be greater than 0 and less than or equal to 1024

curl -X POST http://172.16.6.95:11080/ddl/history -d "limit=1024" > output2.log
  1. run below command, it gets 1024 ddl history jobs with the parameter 'limit'.
curl -X POST http://172.16.6.95:11080/ddl/history -d "limit=1024" > output2.log
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 5357k    0 5357k  100    10  22.0M     42 --:--:-- --:--:-- --:--:-- 22.0M

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.

Limit the count of jobs when getting the ddl history jobs.

@ti-chi-bot ti-chi-bot added affects-6.5 affects-7.1 affects-8.1 ok-to-test Indicates a PR is ready to be tested. 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-6.5 This PR is cherry-picked to release-6.5 from a source PR. labels Sep 19, 2024
Copy link

ti-chi-bot bot commented Sep 19, 2024

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be approved by the approvers firstly.
  2. AFTER it has been approved by approvers, please wait for the cherry-pick merging approval from triage owners.

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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 19, 2024
Copy link

ti-chi-bot bot commented Sep 19, 2024

@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/unit-test 05de9bb link true /test unit-test
idc-jenkins-ci-tidb/check_dev 05de9bb link true /test check-dev
idc-jenkins-ci-tidb/check_dev_2 05de9bb link true /test check-dev2
idc-jenkins-ci-tidb/build 05de9bb link true /test build
idc-jenkins-ci-tidb/mysql-test 05de9bb 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.

@joccau joccau requested a review from xiabee September 19, 2024 02:35
Copy link

ti-chi-bot bot commented Sep 19, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xiabee
Once this PR has been reviewed and has the lgtm label, please ask for approval from joccau, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 Sep 19, 2024

@xiabee: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 affects-7.1 affects-8.1 do-not-merge/cherry-pick-not-approved ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-6.5 This PR is cherry-picked to release-6.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants