From bee55d204438df6e77638fe7d079b942f327f61f Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Tue, 21 May 2019 21:36:04 +0800 Subject: [PATCH] add write conflict error for latch (#334) Signed-off-by: Shuaipeng Yu --- 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 4f6427bbb..b42568b88 100644 --- a/mysql/errcode.go +++ b/mysql/errcode.go @@ -923,6 +923,8 @@ const ( ErrMemExceedThreshold = 8001 ErrForUpdateCantRetry = 8002 ErrAdminCheckTable = 8003 + ErrTxnTooLarge = 8004 + ErrWriteConflictInTiDB = 8005 ErrInvalidPluginID = 8101 ErrInvalidPluginManifest = 8102 ErrInvalidPluginName = 8103 @@ -941,6 +943,4 @@ const ( ErrRegionUnavailable = 9005 ErrGCTooEarly = 9006 ErrWriteConflict = 9007 - - ErrTxnTooLarge = 9500 ) diff --git a/mysql/errname.go b/mysql/errname.go index 37c69ff51..063e5a717 100644 --- a/mysql/errname.go +++ b/mysql/errname.go @@ -916,10 +916,11 @@ var MySQLErrName = map[uint16]string{ ErrRoleNotGranted: "%s is is not granted to %s", // 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", @@ -938,6 +939,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, conflictStartTS=%d, conflictCommitTS=%d, key=%s", - - ErrTxnTooLarge: "Transaction is too large", }