Skip to content

Commit

Permalink
executor: enhance data inconsistency report (#27388)
Browse files Browse the repository at this point in the history
  • Loading branch information
lysu authored Sep 13, 2021
1 parent 6514317 commit 32c8c9e
Show file tree
Hide file tree
Showing 17 changed files with 853 additions and 106 deletions.
6 changes: 3 additions & 3 deletions errno/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,8 @@ const (
ErrMultiStatementDisabled = 8130
ErrPartitionStatsMissing = 8131
ErrNotSupportedWithSem = 8132
ErrDataInConsistentExtraIndex = 8133
ErrDataInConsistentMisMatchIndex = 8134
ErrDataInconsistentMismatchCount = 8133
ErrDataInconsistentMismatchIndex = 8134
ErrAsOf = 8135

// Error codes used by TiDB ddl package
Expand All @@ -1033,7 +1033,7 @@ const (
ErrWriteOnSnapshot = 8220
ErrInvalidKey = 8221
ErrInvalidIndexKey = 8222
ErrDataInConsistent = 8223
ErrDataInconsistent = 8223
ErrDDLJobNotFound = 8224
ErrCancelFinishedDDLJob = 8225
ErrCannotCancelDDLJob = 8226
Expand Down
6 changes: 3 additions & 3 deletions errno/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,16 +998,16 @@ var MySQLErrName = map[uint16]*mysql.ErrMessage{
ErrWriteOnSnapshot: mysql.Message("write on snapshot", nil),
ErrInvalidKey: mysql.Message("invalid key", nil),
ErrInvalidIndexKey: mysql.Message("invalid index key", nil),
ErrDataInConsistent: mysql.Message("index:%#v != record:%#v", []int{0, 1}),
ErrDataInconsistent: mysql.Message("data inconsistency in table: %s, index: %s, handle: %s, index-values:%#v != record-values:%#v", []int{2, 3, 4}),
ErrDDLReorgElementNotExist: mysql.Message("DDL reorg element does not exist", nil),
ErrDDLJobNotFound: mysql.Message("DDL Job:%v not found", nil),
ErrCancelFinishedDDLJob: mysql.Message("This job:%v is finished, so can't be cancelled", nil),
ErrCannotCancelDDLJob: mysql.Message("This job:%v is almost finished, can't be cancelled now", nil),
ErrUnknownAllocatorType: mysql.Message("Invalid allocator type", nil),
ErrAutoRandReadFailed: mysql.Message("Failed to read auto-random value from storage engine", nil),
ErrInvalidIncrementAndOffset: mysql.Message("Invalid auto_increment settings: auto_increment_increment: %d, auto_increment_offset: %d, both of them must be in range [1..65535]", nil),
ErrDataInConsistentExtraIndex: mysql.Message("handle %#v, index:%#v != record:%#v", []int{0, 1, 2}),
ErrDataInConsistentMisMatchIndex: mysql.Message("col %s, handle %#v, index:%#v != record:%#v, compare err:%#v", []int{1, 2, 3, 4}),
ErrDataInconsistentMismatchCount: mysql.Message("data inconsistency in table: %s, index: %s, index-count:%d != record-count:%d", nil),
ErrDataInconsistentMismatchIndex: mysql.Message("data inconsistency in table: %s, index: %s, col: %s, handle: %#v, index-values:%#v != record-values:%#v, compare err:%#v", []int{3, 4, 5, 6}),

ErrWarnOptimizerHintInvalidInteger: mysql.Message("integer value is out of range in '%s'", nil),
ErrWarnOptimizerHintUnsupportedHint: mysql.Message("Optimizer hint %s is not supported by TiDB and is ignored", nil),
Expand Down
6 changes: 3 additions & 3 deletions errors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ TiDB admin check table failed.

["admin:8223"]
error = '''
index:%#v != record:%#v
data inconsistency in table: %s, index: %s, handle: %s, index-values:%#v != record-values:%#v
'''

["admin:8224"]
Expand Down Expand Up @@ -873,12 +873,12 @@ Export failed: %s

["executor:8133"]
error = '''
handle %#v, index:%#v != record:%#v
data inconsistency in table: %s, index: %s, index-count:%d != record-count:%d
'''

["executor:8134"]
error = '''
col %s, handle %#v, index:%#v != record:%#v, compare err:%#v
data inconsistency in table: %s, index: %s, col: %s, handle: %#v, index-values:%#v != record-values:%#v, compare err:%#v
'''

["executor:8212"]
Expand Down
Loading

0 comments on commit 32c8c9e

Please sign in to comment.