From 467136412c6f3e577c93a7a6cd03cb9ead605c8b Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Wed, 10 Apr 2019 13:56:11 +0800 Subject: [PATCH 1/2] add write conflict error (#281) --- mysql/errcode.go | 1 + mysql/errname.go | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql/errcode.go b/mysql/errcode.go index 43ce4ee5c..4bb71de48 100644 --- a/mysql/errcode.go +++ b/mysql/errcode.go @@ -914,6 +914,7 @@ const ( ErrResolveLockTimeout = 9004 ErrRegionUnavailable = 9005 ErrGCTooEarly = 9006 + ErrWriteConflict = 9007 ErrTxnTooLarge = 9500 ) diff --git a/mysql/errname.go b/mysql/errname.go index 0f7c98329..a29ababe4 100644 --- a/mysql/errname.go +++ b/mysql/errname.go @@ -912,6 +912,7 @@ var MySQLErrName = map[uint16]string{ ErrResolveLockTimeout: "Resolve lock timeout", ErrRegionUnavailable: "Region is unavailable", ErrGCTooEarly: "GC life time is shorter than transaction duration, transaction starts at %v, GC safe point is %v", + ErrWriteConflict: "Write conflict, txnStartTS=%d, conflictTS=%d, key=%s", ErrTxnTooLarge: "Transaction is too large", } From 23753bed62fccd50f3173b35669062c82fc74ff1 Mon Sep 17 00:00:00 2001 From: Haibin Xie Date: Tue, 22 Oct 2019 14:54:42 +0800 Subject: [PATCH 2/2] add write conflict error for latch (#334) --- mysql/errcode.go | 4 ++-- mysql/errname.go | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mysql/errcode.go b/mysql/errcode.go index 4bb71de48..9f94643bf 100644 --- a/mysql/errcode.go +++ b/mysql/errcode.go @@ -897,6 +897,8 @@ const ( ErrMemExceedThreshold = 8001 ErrForUpdateCantRetry = 8002 ErrAdminCheckTable = 8003 + ErrTxnTooLarge = 8004 + ErrWriteConflictInTiDB = 8005 ErrInvalidPluginID = 8101 ErrInvalidPluginManifest = 8102 ErrInvalidPluginName = 8103 @@ -915,6 +917,4 @@ const ( ErrRegionUnavailable = 9005 ErrGCTooEarly = 9006 ErrWriteConflict = 9007 - - ErrTxnTooLarge = 9500 ) diff --git a/mysql/errname.go b/mysql/errname.go index a29ababe4..eb5e07ac7 100644 --- a/mysql/errname.go +++ b/mysql/errname.go @@ -891,10 +891,11 @@ var MySQLErrName = map[uint16]string{ ErrJSONUsedAsKey: "JSON column '%-.192s' cannot be used in key specification.", // TiDB errors. - ErrMemExceedThreshold: "%s holds %dB memory, exceeds threshold %dB.%s", - ErrForUpdateCantRetry: "[%d] can not retry select for update statement", - ErrAdminCheckTable: "TiDB admin check table failed.", - + ErrMemExceedThreshold: "%s holds %dB memory, exceeds threshold %dB.%s", + ErrForUpdateCantRetry: "[%d] can not retry select for update statement", + ErrAdminCheckTable: "TiDB admin check table failed.", + ErrTxnTooLarge: "Transaction is too large", + ErrWriteConflictInTiDB: "Write conflict, txnStartTS %d is stale", ErrInvalidPluginID: "Wrong plugin id: %s, valid plugin id is [name]-[version], both name and version should not contain '-'", ErrInvalidPluginManifest: "Cannot read plugin %s's manifest", ErrInvalidPluginName: "Plugin load with %s but got wrong name %s", @@ -913,6 +914,4 @@ var MySQLErrName = map[uint16]string{ ErrRegionUnavailable: "Region is unavailable", ErrGCTooEarly: "GC life time is shorter than transaction duration, transaction starts at %v, GC safe point is %v", ErrWriteConflict: "Write conflict, txnStartTS=%d, conflictTS=%d, key=%s", - - ErrTxnTooLarge: "Transaction is too large", }