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

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

tiancaiamao
Copy link
Contributor

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.

@tiancaiamao tiancaiamao added type/enhancement The issue or PR belongs to an enhancement. type/bugfix This PR fixes a bug. needs-cherry-pick-3.0 labels Dec 11, 2019
@tiancaiamao
Copy link
Contributor Author

image

@tiancaiamao
Copy link
Contributor Author

@tiancaiamao
Copy link
Contributor Author

PTAL @coocood @lysu

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@coocood
Copy link
Member

coocood commented Dec 11, 2019

LGTM

@coocood
Copy link
Member

coocood commented Dec 11, 2019

/merge

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

sre-bot commented Dec 11, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 11, 2019

@tiancaiamao merge failed.

@coocood
Copy link
Member

coocood commented Dec 11, 2019

/run-integration-common-test

@codecov
Copy link

codecov bot commented Dec 11, 2019

Codecov Report

Merging #14031 into master will decrease coverage by 0.4856%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##            master     #14031        +/-   ##
===============================================
- Coverage   80.638%   80.1523%   -0.4857%     
===============================================
  Files          482        482                
  Lines       123479     120780      -2699     
===============================================
- Hits         99571      96808      -2763     
- Misses       16187      16232        +45     
- Partials      7721       7740        +19

@sre-bot
Copy link
Contributor

sre-bot commented Dec 11, 2019

cherry pick to release-3.0 in PR #14032

@tiancaiamao tiancaiamao deleted the large-txn-leak branch December 11, 2019 15:27
@tiancaiamao
Copy link
Contributor Author

Fix #13883

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