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

config: make deadlock history's max size configuable #24925

Merged
merged 16 commits into from
Jun 3, 2021

Conversation

longfangsong
Copy link
Contributor

@longfangsong longfangsong commented May 27, 2021

What problem does this PR solve?

Part of the feature Lock View.

Problem Summary:

Currently the deadlock history max capacity is fixed to 10, we should make it configuable.

What is changed and how it works?

What's Changed: Use PessimisticTxn.DeadlockHistoryCapacity to control the capacity.

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

  • No release note.

@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 27, 2021
@ti-srebot
Copy link
Contributor

@MyonKeminta MyonKeminta mentioned this pull request May 28, 2021
20 tasks
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 1, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Jun 1, 2021
@longfangsong longfangsong marked this pull request as ready for review June 1, 2021 16:21
@longfangsong longfangsong requested a review from a team as a code owner June 1, 2021 16:21
@longfangsong longfangsong requested review from XuHuaiyu and removed request for a team June 1, 2021 16:21
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2021
@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 Jun 2, 2021
@longfangsong
Copy link
Contributor Author

/cc @MyonKeminta
PS. check_dev_2 failed on testSerialSuite.TestCanceledJobTakeTime, which should have nothing to do with this pr.

util/deadlockhistory/deadlock_history.go Outdated Show resolved Hide resolved
util/deadlockhistory/deadlock_history.go Outdated Show resolved Hide resolved
d.Lock()
defer d.Unlock()
if newCapacity != uint(len(d.deadlocks)) {
current := d.getAll()
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually there is ways to avoid allocating memory twice here. But fine, since the resize is not a frequent operation.

@MyonKeminta MyonKeminta requested a review from cfzjywxk June 2, 2021 05:08
Copy link
Contributor

@cfzjywxk cfzjywxk left a comment

Choose a reason for hiding this comment

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

/lgtm

@ti-chi-bot
Copy link
Member

@cfzjywxk: Please use GitHub review feature instead of /lgtm [cancel] when you want to submit review to the pull request.
For how to use GitHub review feature, see also this document provided by GitHub.

For the reason we drop support to the commands, see also this page.
This reply is being used as a temporary reply during the migration of review process and will be removed on July 1st.

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.

@MyonKeminta
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@MyonKeminta: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

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

@MyonKeminta MyonKeminta added the sig/transaction SIG:Transaction label Jun 2, 2021
@ti-chi-bot
Copy link
Member

@MyonKeminta: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

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.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 2, 2021
@longfangsong
Copy link
Contributor Author

/run-all-tests

@MyonKeminta
Copy link
Contributor

@cfzjywxk please approve this PR again. The previous one is invalid becuase the sig/transaction label is missing before.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • MyonKeminta
  • cfzjywxk

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 3, 2021
@MyonKeminta
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: ff242e8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 3, 2021
@ti-chi-bot
Copy link
Member

@longfangsong: 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

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.

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.

1 similar comment
@ti-chi-bot
Copy link
Member

@longfangsong: 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

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.

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.

@MyonKeminta
Copy link
Contributor

/merge

@ti-chi-bot ti-chi-bot merged commit c44b8d1 into pingcap:master Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config sig/execution SIG execution sig/sql-infra SIG: SQL Infra sig/transaction SIG:Transaction size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants