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

*: disable batch DMLs by default #13081

Merged
merged 5 commits into from
Nov 7, 2019
Merged

Conversation

jackysp
Copy link
Member

@jackysp jackysp commented Nov 1, 2019

What problem does this PR solve?

Batching commit a DML statement is useless when TiDB supports larger transaction.

What is changed and how it works?

Disable it by default.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch

Signed-off-by: Shuaipeng Yu <[email protected]>
@jackysp jackysp added the sig/execution SIG execution label Nov 1, 2019
@codecov
Copy link

codecov bot commented Nov 1, 2019

Codecov Report

Merging #13081 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13081   +/-   ##
===========================================
  Coverage   80.2724%   80.2724%           
===========================================
  Files           469        469           
  Lines        112153     112153           
===========================================
  Hits          90028      90028           
  Misses        15197      15197           
  Partials       6928       6928

h.mu.Unlock()
}()
for {
sql := fmt.Sprintf("delete from mysql.stats_feedback where table_id = %d and hist_id = %d and is_index = %d", tableID, histID, isIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not directly add limit here? The error handling would be simpler.
And maybe 100000 is too large, what about 10000?

Signed-off-by: Shuaipeng Yu <[email protected]>
Copy link
Contributor

@alivxxx alivxxx 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 jackysp requested a review from coocood November 5, 2019 02:31
@coocood
Copy link
Member

coocood commented Nov 5, 2019

LGTM

h.mu.ctx.GetSessionVars().BatchDelete = false
h.mu.Unlock()
return errors.Trace(err)
defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

defer h.mu.Unlock()

Copy link
Member Author

Choose a reason for hiding this comment

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

done, PTAL

Signed-off-by: Shuaipeng Yu <[email protected]>
@tiancaiamao
Copy link
Contributor

LGTM

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

sre-bot commented Nov 7, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 7, 2019

@jackysp merge failed.

@jackysp
Copy link
Member Author

jackysp commented Nov 7, 2019

/run-unit-test

@jackysp jackysp merged commit 26174f1 into pingcap:master Nov 7, 2019
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
@jackysp jackysp deleted the disable_batch_dmls branch February 27, 2020 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants