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

session: fix out of memory in the batch operations #7086

Merged
merged 1 commit into from
Jul 18, 2018

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Jul 18, 2018

What have you changed? (mandatory)

Batch operations in TiDB (batch_insert, batch_delete, load data) use NewTxn() when reach the batch limitation. TxnCtx in NewTxn() should also be reset, otherwise, it will reference a huge memory which may cause TiDB OOM.

What is the type of the changes? (mandatory)

  • Bug fix (non-breaking change which fixes an issue)

How has this PR been tested? (mandatory)

manual test
insert 10000000 rows by

set tidb_batch_insert = 1;
insert into t select * from sbtest1;

image

Does this PR affect documentation (docs/docs-cn) update? (mandatory)

No.

Does this PR affect tidb-ansible update? (mandatory)

No.

Does this PR need to be added to the release notes? (mandatory)

release note:
Fix out of memory in TiDB batch operations.

PTAL @coocood @tiancaiamao

@jackysp jackysp added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/execution SIG execution labels Jul 18, 2018
@jackysp
Copy link
Member Author

jackysp commented Jul 18, 2018

/run-all-tests

@coocood
Copy link
Member

coocood commented Jul 18, 2018

LGTM

1 similar comment
@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added the status/LGT2 Indicates that a PR has LGTM 2. label Jul 18, 2018
@jackysp
Copy link
Member Author

jackysp commented Jul 18, 2018

I've added the test report. PTAL @coocood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants