Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

*: only retry for special message with 1105 #330

Merged
merged 2 commits into from
Oct 23, 2019

Conversation

csuzhangxc
Copy link
Member

@csuzhangxc csuzhangxc commented Oct 22, 2019

What problem does this PR solve?

1105 means an unknown error in MySQL/TiDB. some of these errors are retryable, but some are not (like error="Error 1105: statement count 5001 exceeds the transaction limitation).

What is changed and how it works?

only retry for retryable errors, now including:

  • Information schema is out of date
  • Information schema is changed

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note

@csuzhangxc csuzhangxc added priority/normal Minor change, requires approval from ≥1 primary reviewer status/PTAL This PR is ready for review. Add this label back after committing new changes type/bug-fix Bug fix needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Oct 22, 2019
@codecov
Copy link

codecov bot commented Oct 22, 2019

Codecov Report

Merging #330 into master will decrease coverage by 0.0278%.
The diff coverage is 0%.

@@               Coverage Diff                @@
##             master       #330        +/-   ##
================================================
- Coverage   59.9177%   59.8898%   -0.0279%     
================================================
  Files           135        135                
  Lines         15079      15076         -3     
================================================
- Hits           9035       9029         -6     
- Misses         5163       5167         +4     
+ Partials        881        880         -1

@csuzhangxc
Copy link
Member Author

@WangXiangUSTC @amyangfei PTAL

@@ -238,7 +238,7 @@ func (conn *DBConn) executeSQLWithIgnore(tctx *tcontext.Context, ignoreError fun
sqlRetriesTotal.WithLabelValues("stmt_exec", conn.cfg.Name).Add(1)
return true
}
if retry.IsRetryableErrorFastFailFilter(err) {
if retry.IsRetryableError(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why change to this function? seems change retry logic for ddl

Copy link
Member Author

@csuzhangxc csuzhangxc Oct 22, 2019

Choose a reason for hiding this comment

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

IsRetryableErrorFastFailFilter as a black-list for 1105, but we have changed to use a white-list for 1105 now.

so, the fast fail error in IsRetryableErrorFastFailFilter will not be retry in IsRetryableError.

UnsupportedDDLMsgs still not be retry.

@WangXiangUSTC
Copy link
Contributor

LGTM

@WangXiangUSTC WangXiangUSTC added status/LGT1 One reviewer already commented LGTM and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Oct 22, 2019
Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

LGTM

@amyangfei amyangfei added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels Oct 23, 2019
@csuzhangxc csuzhangxc merged commit 3e766c4 into pingcap:master Oct 23, 2019
@csuzhangxc csuzhangxc deleted the retry-1105 branch October 23, 2019 02:58
@sre-bot
Copy link

sre-bot commented Oct 23, 2019

cherry pick to release-1.0 in PR #332

@sre-bot sre-bot added already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked and removed needs-cherry-pick-release-1.0 This PR should be cherry-picked to release-1.0. Remove this label after cherry-picked to release-1.0 labels Oct 23, 2019
@csuzhangxc csuzhangxc added already-update-release-note The release note is updated. Add this label once the release note is updated and removed needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Nov 1, 2019
lichunzhu pushed a commit to lichunzhu/dm that referenced this pull request Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
already-cherry-pick-1.0 The related PR is already cherry-picked to release-1.0. Add this label once the PR is cherry-picked already-update-release-note The release note is updated. Add this label once the release note is updated priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge type/bug-fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants