Skip to content

Commit

Permalink
optimize: optimize tcc fence record not exists errMessage (apache#4981)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-ganyu authored Oct 9, 2022
1 parent f300ca6 commit 6c1c857
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#4946](https://github.com/seata/seata/pull/4946)] pass the sqlexception to client when get lock
- [[#4962](https://github.com/seata/seata/pull/4962)] optimize build and fix the base image
- [[#4974](https://github.com/seata/seata/pull/4974)] optimize cancel the limit on the number of globalStatus queries in Redis mode
- [[#4981](https://github.com/seata/seata/pull/4981)] optimize tcc fence record not exists errMessage

### test:
- [[#4794](https://github.com/seata/seata/pull/4794)] try to fix the test `DataSourceProxyTest.getResourceIdTest()`
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- [[#4946](https://github.com/seata/seata/pull/4946)] 将获取锁时遇到的sql异常传递给客户端
- [[#4962](https://github.com/seata/seata/pull/4962)] 优化构建配置,并修正docker镜像的基础镜像
- [[#4974](https://github.com/seata/seata/pull/4974)] 取消redis模式下,查询globalStatus条数的限制
- [[#4981](https://github.com/seata/seata/pull/4981)] 优化当tcc栅栏记录查不到时的错误提示

### test:
- [[#4794](https://github.com/seata/seata/pull/4794)] 重构代码,尝试修复单元测试 `DataSourceProxyTest.getResourceIdTest()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ public enum FrameworkErrorCode {
DateSourceNeedInjected("0501","TCC fence datasource need injected","TCC fence datasource need injected"),

/**
* TCC fence record already exists
* TCC fence record not exists
*/
RecordAlreadyExists("0502","TCC fence record already exists","TCC fence record already exists"),
RecordNotExists("0502","TCC fence record not exists","TCC fence record not exists"),

/**
* Insert tcc fence record error
Expand Down
2 changes: 1 addition & 1 deletion tcc/src/main/java/io/seata/rm/tcc/TCCFenceHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static boolean commitFence(Method commitMethod, Object targetTCCBean,
TCCFenceDO tccFenceDO = TCC_FENCE_DAO.queryTCCFenceDO(conn, xid, branchId);
if (tccFenceDO == null) {
throw new TCCFenceException(String.format("TCC fence record not exists, commit fence method failed. xid= %s, branchId= %s", xid, branchId),
FrameworkErrorCode.RecordAlreadyExists);
FrameworkErrorCode.RecordNotExists);
}
if (TCCFenceConstant.STATUS_COMMITTED == tccFenceDO.getStatus()) {
LOGGER.info("Branch transaction has already committed before. idempotency rejected. xid: {}, branchId: {}, status: {}", xid, branchId, tccFenceDO.getStatus());
Expand Down

0 comments on commit 6c1c857

Please sign in to comment.