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

topsql: optimize life cycle of stmtstats (#31727) #31749

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jan 17, 2022

cherry-pick #31727 to release-5.4
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/31749

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/tidb.git pr/31749:release-5.4-34ce5b5e6032

Signed-off-by: mornyx [email protected]

What problem does this PR solve?

Issue Number: ref #31704

I changed the owner of StatementStats from SessionVars to session. SessionVars have no corresponding Close method, so it is not robust to close internal fields of SessionVars externally. We manage the creation and destruction of StatementStats in session, which guarantees the same number of instances of StatementStats as session.

This can significantly reduce the number of StatementStats leaks, keeping the same number of leaks as session.

Release note

None

@ti-srebot ti-srebot requested a review from a team as a code owner January 17, 2022 13:12
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • bb7133
  • breeswish

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-srebot
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/cherry-pick-not-approved labels Jan 17, 2022
@ti-srebot ti-srebot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/5.4-cherry-pick labels Jan 17, 2022
@ti-srebot
Copy link
Contributor Author

@bb7133 you're already a collaborator in bot's repo.

@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Jan 17, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 17, 2022
Copy link
Member

@bb7133 bb7133 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 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 Jan 17, 2022
@bb7133
Copy link
Member

bb7133 commented Jan 17, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 18b804f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 17, 2022
@mornyx
Copy link
Contributor

mornyx commented Jan 17, 2022

/run-check_dev

2 similar comments
@breezewish
Copy link
Member

/run-check_dev

@mornyx
Copy link
Contributor

mornyx commented Jan 17, 2022

/run-check_dev

@crazycs520
Copy link
Contributor

/merge

@ti-chi-bot ti-chi-bot merged commit 3a44f6d into pingcap:release-5.4 Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 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. type/5.4-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants