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

store/tikv: fix a memory leak in the batchClient for the large transactions (#14031) #14032

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Dec 11, 2019

cherry-pick #14031 to release-3.0


What problem does this PR solve?

Fix a memory leak.

What is changed and how it works?

Change xxx = xxx[:0] to some deep reset operation.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Run some large transactions severals and observe the heap pprof.

mysql> truncate table sbtest2;                                                                                                                                                                        Query OK, 0 rows affected (1.15 sec)

mysql> insert into sbtest2 select * from sbtest1 limit 15000000;                                                                                                                                      Query OK, 15000000 rows affected (4 min 48.79 sec)
Records: 15000000  Duplicates: 0  Warnings: 0

mysql> truncate sbtest2;
Query OK, 0 rows affected (1.15 sec)

mysql> insert into sbtest2 select * from sbtest1 limit 10000000;
Query OK, 10000000 rows affected (2 min 59.24 sec)
Records: 10000000  Duplicates: 0  Warnings: 0

mysql> truncate sbtest2;
Query OK, 0 rows affected (1.04 sec)

mysql> insert into sbtest2 select * from sbtest1 limit 5000000;
Query OK, 5000000 rows affected (1 min 30.57 sec)
Records: 5000000  Duplicates: 0  Warnings: 0

Side effects

  • Possible performance regression

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Write release note for bug-fix or new feature.

@sre-bot
Copy link
Contributor Author

sre-bot commented Dec 11, 2019

/run-all-tests

@coocood
Copy link
Member

coocood commented Dec 11, 2019

LGTM

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@jackysp
Copy link
Member

jackysp commented Dec 12, 2019

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 12, 2019
@sre-bot
Copy link
Contributor Author

sre-bot commented Dec 12, 2019

Your auto merge job has been accepted, waiting for 14026, 13998

@sre-bot
Copy link
Contributor Author

sre-bot commented Dec 12, 2019

/run-all-tests

@sre-bot sre-bot merged commit b10d1a5 into pingcap:release-3.0 Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants