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

pkg/retry: add some retryable error #256

Merged
merged 1 commit into from
Aug 29, 2019
Merged

Conversation

WangXiangUSTC
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC commented Aug 29, 2019

What problem does this PR solve?

some tidb error can be resolved by retry, add some retryable error type

What is changed and how it works?

add some error

ErrQueryInterrupted: query execution was interrupted by user
ErrWriteConflictInTiDB: commit meets an write conflict error
ErrWriteConflict: similar with ErrWriteConflictInTiDB
ErrTableLocked: the table was locked by other session, can retry success when other session release the lock.

@WangXiangUSTC WangXiangUSTC 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/enhancement Performance improvement or refactoring labels Aug 29, 2019
@codecov
Copy link

codecov bot commented Aug 29, 2019

Codecov Report

Merging #256 into master will decrease coverage by 0.0137%.
The diff coverage is 0%.

@@               Coverage Diff                @@
##             master       #256        +/-   ##
================================================
- Coverage   59.9383%   59.9246%   -0.0138%     
================================================
  Files           130        130                
  Lines         14595      14595                
================================================
- Hits           8748       8746         -2     
- Misses         5012       5013         +1     
- Partials        835        836         +1

@csuzhangxc
Copy link
Member

@WangXiangUSTC Add any description about these newly added error codes?

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.

ErrQueryInterrupted curious about this error. When this error happens, does it mean no data wrote in each version of TiDB

@WangXiangUSTC
Copy link
Contributor Author

@csuzhangxc description added

@WangXiangUSTC
Copy link
Contributor Author

@amyangfei this error occurred when some one kill the query

Copy link
Member

@csuzhangxc csuzhangxc left a comment

Choose a reason for hiding this comment

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

LGTM

@csuzhangxc csuzhangxc 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 Aug 29, 2019
@amyangfei
Copy link
Contributor

@amyangfei this error occurred when some one kill the query

maybe a query/execute longer than timeout will cause this error in our use scenario, otherwise our db op may not cancel a query (except for context canceled, then retry is not needed yet)

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 Aug 29, 2019
@WangXiangUSTC WangXiangUSTC merged commit c465050 into master Aug 29, 2019
@WangXiangUSTC WangXiangUSTC deleted the xiang/retry_error branch August 29, 2019 09:52
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
priority/normal Minor change, requires approval from ≥1 primary reviewer status/LGT2 Two reviewers already commented LGTM, ready for merge type/enhancement Performance improvement or refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants