【Seata】04 - Seata TCC 模式 Demo 调用流程分析

文章目录

    • 前言
    • 参考目录
    • 版本说明
    • 前置知识
      • 1、TCC 模式预留资源
      • 2、TCC 模式可能会出现的问题
        • 2.1、幂等性问题
        • 2.2、空回滚问题
        • 2.3、悬挂问题
    • 测试 Demo
      • 1、数据库表结构
      • 2、模块说明
      • 3、调用逻辑说明
      • 4、分析流程说明
    • Seata TCC 模式 Commit 调用流程
      • 1、调用流程图
      • 2、TCC 动作拦截器(事务分支注册)
      • 3、事务分支提交
    • Seata TCC 模式 Rollback 调用流程
      • 1、调用流程图
      • 2、事务分支回滚
    • 附录
      • Commit 调用流程 Client 端控制台输出
        • 业务模块(business-tcc)
        • 库存模块(stock-tcc)
        • 订单模块(order-tcc)
        • 账户模块(account-tcc)
      • Commit 调用流程 Server 端控制台输出
        • 按时序整理的完整流程输出(包含Client 端、Server 端)
      • Rollback 调用流程 Client 端控制台输出
        • 业务模块(business-tcc)
        • 库存模块(stock-tcc)
        • 订单模块(order-tcc)
        • 账户模块(account-tcc)
      • Rollback 调用流程 Server 端控制台输出
        • 按时序整理的完整流程输出(包含Client 端、Server 端)

前言

前面的博客分别整理了 XA 模式与 AT 模式,它们都属于两阶段提交模型,这篇文章也是讲述另外一个两阶段模型—— TCC 模式。对于最常用的 AT 模型,只需要加入相关的配置信息、添加 undo_log 数据库表,并编写业务代码即可,用户无需关心底层数据操作;而相对于自动挡的 AT 模式,TCC 模式除了业务逻辑之外还需要管理自定义的 commit 或者 rollback 操作,官方也给出了以下的说明:

(截图自官方文档)
在这里插入图片描述

参考目录

  • Seata 官方文档
  • Seata TCC 模式
  • 《阿里云云原生架构实践》
    书本章节 3.5 介绍了分布式事务模式的相关内容。

版本说明

本文使用的版本如下:

  • SeataV1.7.0
  • druid-spring-boot-starterV1.2.16

前置知识

1、TCC 模式预留资源

TCC 模式在官方文档中的讲解比较简单,所以在此补充说明一下。

TCC 实际上是 Try、Confirm 和 Cancel 的简称,将事务的提交过程分为 try-confirm cancel 三个阶段。try 阶段完成业务检查、预留业务资源;confirm 阶段使用预留的资源执行业务操作;cancel 阶段取消执行业务操作,释放预留的资源。
(摘自《阿里云云原生架构实践》3.5.3 TCC)

在前言部分也有官方文档的截图是关于 AT 模式与 TCC 模式的对比。上面的文字反复提及了一个概念——预留资源,这个概念实际上就是充当了 AT 模式中前后镜像的功能。

举个栗子来说明一下:

  • 用户 A 和用户 B,各有 ¥100。
  • A 向 B 转账 ¥50。(这个变化的 ¥50 即预留资源
  • 转账完成,A 剩余¥50,B 则有¥150。

可以简单点理解成,预留资源就是用来做回滚用的。假如 A 向 B 转账过程中出现了异常,那么就会根据这个预留资源把 ¥50 加回给 A。

因此,在下面的 Demo 中,我给原本的三张业务表分别加上了各自的预留资源的字段,便于进行后续操作。

2、TCC 模式可能会出现的问题

因为 TCC 模式实际上在生产环境用得比较少,所以在此简单带过一下可能会出现的一些问题,方便以后回滚复习。

2.1、幂等性问题

这个比较好理解,在 TCC 模式中,一个全局事务 try-comfirm 或者是 try-cancel 只能执行一次。但是可能会由于网络问题等造成的执行了两次相同的方法而导致数据前后不一致。

2.2、空回滚问题

这个问题和预留资源相关。

首先需要知道分别定义好了 try、comfirm、cancel 的实现方法。假设在 try 阶段,业务代码还没有执行到与数据库相关的操作时就已经报错了,此时会进入 cancel 方法,因为没有预留资源,当回滚时会出现数据不一致的情况,就是空回滚。

例如:A 转账给 B,执行了 A - 50 的操作,但是还没执行到到 B + 50 的 SQL 操作,此时报错了,此时进入了 cancel 阶段,执行 rollback 方法,正常来说结果应该是 A 和 B 各 100,但是实际上得到的结果却是 A 变回 100,B 变成了 150。

2.3、悬挂问题

还是举个栗子来说明:

  • 全局事务有 A 和 B 两个事务分支属于两个不同模块,相互之间通过 RPC 调用。
  • A 调用 B 时,由于网络延迟导致超时了,此时 A 进行了回滚操作。
  • 回滚操作之后,RPC 请求又到达了 B 并执行了 try 方法。
  • 由于 A 执行了 cancel,导致了 B 预留的资源无法释放。

这就是悬挂。

Seata TCC事务模式在 V1.5.0 增加防悬挂功能,需要新增一张表 tcc_fence_log,在 Demo 中也进行了相应配置。

测试 Demo

官方也提供了关于 TCC 模式的 Demo,不过我觉得不太好用,所以就在原本 XA 模式 Demo 的基础上重新写了一个 TCC Demo,能复用的代码几乎都复用了,Demo 以及使用的 Server 打成了压缩包(在文章开头)可以自行下载使用。

1、数据库表结构

因为业务流程没有变化,所以业务表使用的还是最开始的三张业务表,只是在此基础上加了数据留存的字段,以及加了一张 TCC 模式需要使用的表 tcc_fence_log

相关的 SQL:

-- -------------------------------- The script use tcc fence  --------------------------------
CREATE TABLE IF NOT EXISTS `tcc_fence_log`
(`xid`           VARCHAR(128)  NOT NULL COMMENT 'global id',`branch_id`     BIGINT        NOT NULL COMMENT 'branch id',`action_name`   VARCHAR(64)   NOT NULL COMMENT 'action name',`status`        TINYINT       NOT NULL COMMENT 'status(tried:1;committed:2;rollbacked:3;suspended:4)',`gmt_create`    DATETIME(3)   NOT NULL COMMENT 'create time',`gmt_modified`  DATETIME(3)   NOT NULL COMMENT 'update time',PRIMARY KEY (`xid`, `branch_id`),KEY `idx_gmt_modified` (`gmt_modified`),KEY `idx_status` (`status`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;-- stock --
ALTER TABLE `seata`.`stock_tbl` 
ADD COLUMN `reduce` int(0) NULL DEFAULT 0 AFTER `count`;-- order --
ALTER TABLE `seata`.`order_tbl` 
ADD COLUMN `order_no` varchar(255) NULL AFTER `money`;-- account --
ALTER TABLE `seata`.`account_tbl` 
ADD COLUMN `reduce` int(0) NULL DEFAULT 0 AFTER `money`;

tcc_fence_log 是 TCC 模式防悬挂功能的表。关于悬挂问题后面再展开。

库存表 stock_tbl 新增预留资源字段 reduce 记录库存变化。

订单表 order_tbl 新增预留资源字段 order_no 记录订单数据。

账户表 account_tbl 新增预留资源字段 reduce 记录余额变化。

2、模块说明

在这里插入图片描述

Demo 一共四个模块,是经典的下单流程。按照如下顺序启动

  • 账户模块(Port:8083)
  • 订单模块(Port:8082)
  • 库存模块(Port:8081)
  • 业务模块(Port:8084)

模块间使用 openfeign 进行调用。

3、调用逻辑说明

入口:业务模块

http://127.0.0.1:8084/purchase

业务逻辑:

  1. 调用业务模块接口(business-tcc)
  2. 扣减商品库存(stock-tcc)
  3. 新增账户订单(order-tcc)
  4. 账户余额扣减(account-tcc)

(截图自 GitHub README.md)在这里插入图片描述

与 XA、AT 模式不同,TCC 模式需要自定义分支事务逻辑,所以 Demo 中对业务模块进行了拆解,新增了 action 接口及其实现类来编写相关逻辑。

以 Stock 库存模块为例:

在这里插入图片描述

在这里插入图片描述

4、分析流程说明

整个下单操作是一个全局事务,各个模块分属于各个分支事务。下面对源码进行分析时只对其中一个分支操作进行说明,其余分支操作都是相同的,就不再展开说明。

分析分为 Commit 和 Rollback 两种流程。

注:本文的流程分析主要还是依照控制台输出对源码进行分析,要点集中在 RM 与 TC 之间的操作,即事务分支的操作,对于开启全局事务等方法将不再详细说明,可参考 AT 模式。

Seata TCC 模式 Commit 调用流程

1、调用流程图

在这里插入图片描述

步骤前面有数字标识,也标记了主要的类,根据各模块控制台输出整理,详细见附录。

2、TCC 动作拦截器(事务分支注册)

io.seata.spring.tcc.TccActionInterceptor#invoke

在这里插入图片描述

io.seata.rm.tcc.interceptor.ActionInterceptorHandler#proceed

在这里插入图片描述

io.seata.rm.tcc.interceptor.ActionInterceptorHandler#doTccActionLogStore

在这里插入图片描述

io.seata.rm.tcc.interceptor.ActionInterceptorHandler#fetchActionRequestContext

在这里插入图片描述

io.seata.rm.tcc.interceptor.ActionInterceptorHandler#initBusinessContext

在这里插入图片描述

注册分支方法和 AT 模式一致,向 Server 端(TC)发送分支注册请求:

io.seata.rm.AbstractResourceManager#branchRegister

在这里插入图片描述

分支注册完成,返回 ActionInterceptorHandler 拦截器处理器继续执行。

io.seata.rm.tcc.interceptor.ActionInterceptorHandler#proceed

在这里插入图片描述

io.seata.rm.tcc.TCCFenceHandler#prepareFence

在这里插入图片描述

io.seata.rm.tcc.TCCFenceHandler#insertTCCFenceLog

在这里插入图片描述

io.seata.rm.tcc.store.db.TCCFenceStoreDataBaseDAO#insertTCCFenceDO

在这里插入图片描述

3、事务分支提交

io.seata.core.rpc.processor.client.RmBranchCommitProcessor

在这里插入图片描述

io.seata.rm.AbstractRMHandler#doBranchCommit

在这里插入图片描述

io.seata.rm.tcc.TCCResourceManager#branchCommit

在这里插入图片描述

io.seata.rm.tcc.TCCFenceHandler#commitFence

在这里插入图片描述

io.seata.rm.tcc.TCCFenceHandler#updateStatusAndInvokeTargetMethod

在这里插入图片描述

io.seata.rm.tcc.TCCFenceHandler#updateStatusAndInvokeTargetMethod

在这里插入图片描述

Seata TCC 模式 Rollback 调用流程

1、调用流程图

在这里插入图片描述

步骤前面有数字标识,也标记了主要的类,根据各模块控制台输出整理,详细见附录。

2、事务分支回滚

执行三次业务之后,数据如下:

在这里插入图片描述

第四次执行会抛出异常,并进行回滚。

io.seata.core.rpc.processor.client.RmBranchRollbackProcessor

在这里插入图片描述

io.seata.rm.AbstractRMHandler#handle

在这里插入图片描述

io.seata.rm.AbstractRMHandler#doBranchRollback

在这里插入图片描述

io.seata.rm.tcc.TCCResourceManager#branchRollback

在这里插入图片描述

io.seata.rm.tcc.TCCFenceHandler#rollbackFence

在这里插入图片描述

附录

Commit 调用流程 Client 端控制台输出

业务模块(business-tcc)

2023-09-11 16:07:42.610  INFO 24792 --- [nio-8484-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-09-11 16:07:42.611  INFO 24792 --- [nio-8484-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-09-11 16:07:42.622  INFO 24792 --- [nio-8484-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 11 ms
2023-09-11 16:07:42.676  INFO 24792 --- [nio-8484-exec-1] io.seata.tm.TransactionManagerHolder     : TransactionManager Singleton io.seata.tm.DefaultTransactionManager@3b4a9591
2023-09-11 16:07:42.713  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : Begin new global transaction [192.168.2.126:8091:2252233925503221763]
2023-09-11 16:07:42.717  INFO 24792 --- [nio-8484-exec-1] s.zlyx.example.service.BusinessService   : New Transaction Begins: 192.168.2.126:8091:2252233925503221763
2023-09-11 16:07:43.590  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : transaction 192.168.2.126:8091:2252233925503221763 will be commit
2023-09-11 16:07:43.854  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : transaction end, xid = 192.168.2.126:8091:2252233925503221763
2023-09-11 16:07:43.854  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : [192.168.2.126:8091:2252233925503221763] commit status: Committed

库存模块(stock-tcc)

2023-09-11 16:07:42.815  INFO 24000 --- [nio-8181-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-09-11 16:07:42.815  INFO 24000 --- [nio-8181-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-09-11 16:07:42.822  INFO 24000 --- [nio-8181-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 7 ms
2023-09-11 16:07:42.960  INFO 24000 --- [nio-8181-exec-1] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221763, branchId:2252233925503221765, lockKeys:null
2023-09-11 16:07:42.977  INFO 24000 --- [nio-8181-exec-1] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221765
2023-09-11 16:07:42.980  INFO 24000 --- [nio-8181-exec-1] s.z.e.tccaction.impl.StockActionImpl     : deduct stock balance in transaction: 192.168.2.126:8091:2252233925503221763
2023-09-11 16:07:42.992  INFO 24000 --- [nio-8181-exec-1] s.z.e.tccaction.impl.StockActionImpl     : stock after transaction: 70
2023-09-11 16:07:43.023  WARN 24000 --- [nio-8181-exec-1] c.a.c.seata.web.SeataHandlerInterceptor  : xid in change during RPC from 192.168.2.126:8091:2252233925503221763 to null
2023-09-11 16:07:43.641  INFO 24000 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchCommitProcessor      : rm client handle branch commit process:BranchCommitRequest{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221765, branchType=TCC, resourceId='tryDeduct', applicationData='{"actionContext":{"action-start-time":1694419662860,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}
2023-09-11 16:07:43.645  INFO 24000 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch committing: 192.168.2.126:8091:2252233925503221763 2252233925503221765 tryDeduct {"actionContext":{"action-start-time":1694419662860,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}
2023-09-11 16:07:43.689  INFO 24000 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource commit result : true, xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221765, resourceId: tryDeduct
2023-09-11 16:07:43.690  INFO 24000 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch commit result: PhaseTwo_Committed

订单模块(order-tcc)

2023-09-11 16:07:43.100  INFO 24332 --- [nio-8282-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-09-11 16:07:43.101  INFO 24332 --- [nio-8282-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-09-11 16:07:43.109  INFO 24332 --- [nio-8282-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 8 ms
2023-09-11 16:07:43.253  INFO 24332 --- [nio-8282-exec-1] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221763, branchId:2252233925503221767, lockKeys:null
2023-09-11 16:07:43.267  INFO 24332 --- [nio-8282-exec-1] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221767
2023-09-11 16:07:43.272  INFO 24332 --- [nio-8282-exec-1] s.z.e.tccaction.impl.OrderActionImpl     : create order in transaction: 192.168.2.126:8091:2252233925503221763
2023-09-11 16:07:43.591  WARN 24332 --- [nio-8282-exec-1] c.a.c.seata.web.SeataHandlerInterceptor  : xid in change during RPC from 192.168.2.126:8091:2252233925503221763 to null
2023-09-11 16:07:43.710  INFO 24332 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchCommitProcessor      : rm client handle branch commit process:BranchCommitRequest{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221767, branchType=TCC, resourceId='tryCreate', applicationData='{"actionContext":{"action-start-time":1694419663154,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}
2023-09-11 16:07:43.712  INFO 24332 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch committing: 192.168.2.126:8091:2252233925503221763 2252233925503221767 tryCreate {"actionContext":{"action-start-time":1694419663154,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}
2023-09-11 16:07:43.749  INFO 24332 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource commit result : true, xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221767, resourceId: tryCreate
2023-09-11 16:07:43.751  INFO 24332 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch commit result: PhaseTwo_Committed

账户模块(account-tcc)

2023-09-11 16:07:43.350  INFO 21608 --- [nio-8383-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-09-11 16:07:43.350  INFO 21608 --- [nio-8383-exec-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-09-11 16:07:43.356  INFO 21608 --- [nio-8383-exec-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 6 ms
2023-09-11 16:07:43.485  INFO 21608 --- [nio-8383-exec-2] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221763, branchId:2252233925503221769, lockKeys:null
2023-09-11 16:07:43.498  INFO 21608 --- [nio-8383-exec-2] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221769
2023-09-11 16:07:43.503  INFO 21608 --- [nio-8383-exec-2] s.z.e.tccaction.impl.AccountActionImpl   : reduce account balance in transaction: 192.168.2.126:8091:2252233925503221763
2023-09-11 16:07:43.513  INFO 21608 --- [nio-8383-exec-2] s.z.e.tccaction.impl.AccountActionImpl   : balance after transaction: 7000
2023-09-11 16:07:43.544  WARN 21608 --- [nio-8383-exec-2] c.a.c.seata.web.SeataHandlerInterceptor  : xid in change during RPC from 192.168.2.126:8091:2252233925503221763 to null
2023-09-11 16:07:43.772  INFO 21608 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchCommitProcessor      : rm client handle branch commit process:BranchCommitRequest{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221769, branchType=TCC, resourceId='tryReduce', applicationData='{"actionContext":{"action-start-time":1694419663400,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}
2023-09-11 16:07:43.773  INFO 21608 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch committing: 192.168.2.126:8091:2252233925503221763 2252233925503221769 tryReduce {"actionContext":{"action-start-time":1694419663400,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}
2023-09-11 16:07:43.833  INFO 21608 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource commit result : true, xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221769, resourceId: tryReduce
2023-09-11 16:07:43.834  INFO 21608 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch commit result: PhaseTwo_Committed

Commit 调用流程 Server 端控制台输出

16:07:42.684  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalBeginRequest{transactionName='purchase(java.lang.String, java.lang.String, int, boolean)', timeout=60000}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:42.706  INFO --- [rverHandlerThread_1_4_500] [coordinator.DefaultCoordinator] [       doGlobalBegin]  [192.168.2.126:8091:2252233925503221763] : Begin new global transaction applicationId: business-tcc,transactionServiceGroup: my_test_tx_group, transactionName: purchase(java.lang.String, java.lang.String, int, boolean),timeout:60000,xid:192.168.2.126:8091:2252233925503221763
16:07:42.708  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalBeginResponse{xid='192.168.2.126:8091:2252233925503221763', extraData='null', resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:42.924  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221763', branchType=TCC, resourceId='tryDeduct', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694419662860,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:42.954  INFO --- [nPool.commonPool-worker-2] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221763] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221763, branchId = 2252233925503221765, resourceId = tryDeduct ,lockKeys = null
16:07:42.955  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221765, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.208  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221763', branchType=TCC, resourceId='tryCreate', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694419663154,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.227  INFO --- [nPool.commonPool-worker-2] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221763] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221763, branchId = 2252233925503221767, resourceId = tryCreate ,lockKeys = null
16:07:43.227  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221767, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.460  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221763', branchType=TCC, resourceId='tryReduce', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694419663400,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.479  INFO --- [nPool.commonPool-worker-2] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221763] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221763, branchId = 2252233925503221769, resourceId = tryReduce ,lockKeys = null
16:07:43.480  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221769, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.594  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalCommitRequest{xid='192.168.2.126:8091:2252233925503221763', extraData='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.694  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchCommitResponse{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221765, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.705  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [bda$doGlobalCommit$1]  [192.168.2.126:8091:2252233925503221763] : Commit branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221763 branchId = 2252233925503221765
16:07:43.755  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchCommitResponse{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221767, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.766  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [bda$doGlobalCommit$1]  [192.168.2.126:8091:2252233925503221763] : Commit branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221763 branchId = 2252233925503221767
16:07:43.837  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchCommitResponse{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221769, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.850  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [bda$doGlobalCommit$1]  [192.168.2.126:8091:2252233925503221763] : Commit branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221763 branchId = 2252233925503221769
16:07:43.850  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [      doGlobalCommit]  [192.168.2.126:8091:2252233925503221763] : Committing global transaction is successfully done, xid = 192.168.2.126:8091:2252233925503221763.
16:07:43.851  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalCommitResponse{globalStatus=Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group

按时序整理的完整流程输出(包含Client 端、Server 端)

16:07:42.684  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalBeginRequest{transactionName='purchase(java.lang.String, java.lang.String, int, boolean)', timeout=60000}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:42.706  INFO --- [rverHandlerThread_1_4_500] [coordinator.DefaultCoordinator] [       doGlobalBegin]  [192.168.2.126:8091:2252233925503221763] : Begin new global transaction applicationId: business-tcc,transactionServiceGroup: my_test_tx_group, transactionName: purchase(java.lang.String, java.lang.String, int, boolean),timeout:60000,xid:192.168.2.126:8091:2252233925503221763
16:07:42.708  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalBeginResponse{xid='192.168.2.126:8091:2252233925503221763', extraData='null', resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group16:07:42.713  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : Begin new global transaction [192.168.2.126:8091:2252233925503221763]
16:07:42.717  INFO 24792 --- [nio-8484-exec-1] s.zlyx.example.service.BusinessService   : New Transaction Begins: 192.168.2.126:8091:225223392550322176316:07:42.924  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221763', branchType=TCC, resourceId='tryDeduct', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694419662860,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:42.954  INFO --- [nPool.commonPool-worker-2] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221763] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221763, branchId = 2252233925503221765, resourceId = tryDeduct ,lockKeys = null
16:07:42.955  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221765, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group16:07:42.960  INFO 24000 --- [nio-8181-exec-1] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221763, branchId:2252233925503221765, lockKeys:null
16:07:42.977  INFO 24000 --- [nio-8181-exec-1] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221765
16:07:42.980  INFO 24000 --- [nio-8181-exec-1] s.z.e.tccaction.impl.StockActionImpl     : deduct stock balance in transaction: 192.168.2.126:8091:2252233925503221763
16:07:42.992  INFO 24000 --- [nio-8181-exec-1] s.z.e.tccaction.impl.StockActionImpl     : stock after transaction: 7016:07:43.208  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221763', branchType=TCC, resourceId='tryCreate', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694419663154,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.227  INFO --- [nPool.commonPool-worker-2] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221763] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221763, branchId = 2252233925503221767, resourceId = tryCreate ,lockKeys = null
16:07:43.227  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221767, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group16:07:43.253  INFO 24332 --- [nio-8282-exec-1] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221763, branchId:2252233925503221767, lockKeys:null
16:07:43.267  INFO 24332 --- [nio-8282-exec-1] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221767
16:07:43.272  INFO 24332 --- [nio-8282-exec-1] s.z.e.tccaction.impl.OrderActionImpl     : create order in transaction: 192.168.2.126:8091:225223392550322176316:07:43.460  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221763', branchType=TCC, resourceId='tryReduce', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694419663400,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.479  INFO --- [nPool.commonPool-worker-2] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221763] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221763, branchId = 2252233925503221769, resourceId = tryReduce ,lockKeys = null
16:07:43.480  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221769, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group16:07:43.485  INFO 21608 --- [nio-8383-exec-2] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221763, branchId:2252233925503221769, lockKeys:null
16:07:43.498  INFO 21608 --- [nio-8383-exec-2] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221769
16:07:43.503  INFO 21608 --- [nio-8383-exec-2] s.z.e.tccaction.impl.AccountActionImpl   : reduce account balance in transaction: 192.168.2.126:8091:2252233925503221763
16:07:43.513  INFO 21608 --- [nio-8383-exec-2] s.z.e.tccaction.impl.AccountActionImpl   : balance after transaction: 700016:07:43.590  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : transaction 192.168.2.126:8091:2252233925503221763 will be commit16:07:43.594  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalCommitRequest{xid='192.168.2.126:8091:2252233925503221763', extraData='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group16:07:43.641  INFO 24000 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchCommitProcessor      : rm client handle branch commit process:BranchCommitRequest{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221765, branchType=TCC, resourceId='tryDeduct', applicationData='{"actionContext":{"action-start-time":1694419662860,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}
16:07:43.645  INFO 24000 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch committing: 192.168.2.126:8091:2252233925503221763 2252233925503221765 tryDeduct {"actionContext":{"action-start-time":1694419662860,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}
16:07:43.689  INFO 24000 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource commit result : true, xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221765, resourceId: tryDeduct
16:07:43.690  INFO 24000 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch commit result: PhaseTwo_Committed16:07:43.694  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchCommitResponse{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221765, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.705  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [bda$doGlobalCommit$1]  [192.168.2.126:8091:2252233925503221763] : Commit branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221763 branchId = 225223392550322176516:07:43.710  INFO 24332 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchCommitProcessor      : rm client handle branch commit process:BranchCommitRequest{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221767, branchType=TCC, resourceId='tryCreate', applicationData='{"actionContext":{"action-start-time":1694419663154,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}
16:07:43.712  INFO 24332 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch committing: 192.168.2.126:8091:2252233925503221763 2252233925503221767 tryCreate {"actionContext":{"action-start-time":1694419663154,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}
16:07:43.749  INFO 24332 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource commit result : true, xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221767, resourceId: tryCreate
16:07:43.751  INFO 24332 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch commit result: PhaseTwo_Committed16:07:43.755  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchCommitResponse{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221767, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.766  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [bda$doGlobalCommit$1]  [192.168.2.126:8091:2252233925503221763] : Commit branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221763 branchId = 225223392550322176716:07:43.772  INFO 21608 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchCommitProcessor      : rm client handle branch commit process:BranchCommitRequest{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221769, branchType=TCC, resourceId='tryReduce', applicationData='{"actionContext":{"action-start-time":1694419663400,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}
16:07:43.773  INFO 21608 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch committing: 192.168.2.126:8091:2252233925503221763 2252233925503221769 tryReduce {"actionContext":{"action-start-time":1694419663400,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}
16:07:43.833  INFO 21608 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource commit result : true, xid: 192.168.2.126:8091:2252233925503221763, branchId: 2252233925503221769, resourceId: tryReduce
16:07:43.834  INFO 21608 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch commit result: PhaseTwo_Committed16:07:43.837  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchCommitResponse{xid='192.168.2.126:8091:2252233925503221763', branchId=2252233925503221769, branchStatus=PhaseTwo_Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
16:07:43.850  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [bda$doGlobalCommit$1]  [192.168.2.126:8091:2252233925503221763] : Commit branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221763 branchId = 225223392550322176916:07:43.850  INFO --- [rverHandlerThread_1_8_500] [server.coordinator.DefaultCore] [      doGlobalCommit]  [192.168.2.126:8091:2252233925503221763] : Committing global transaction is successfully done, xid = 192.168.2.126:8091:2252233925503221763.
16:07:43.851  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalCommitResponse{globalStatus=Committed, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group16:07:43.854  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : transaction end, xid = 192.168.2.126:8091:2252233925503221763
16:07:43.854  INFO 24792 --- [nio-8484-exec-1] i.seata.tm.api.DefaultGlobalTransaction  : [192.168.2.126:8091:2252233925503221763] commit status: Committed

Rollback 调用流程 Client 端控制台输出

业务模块(business-tcc)

2023-09-11 17:47:06.443  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : Begin new global transaction [192.168.2.126:8091:2252233925503221807]
2023-09-11 17:47:06.443  INFO 24792 --- [nio-8484-exec-7] s.zlyx.example.service.BusinessService   : New Transaction Begins: 192.168.2.126:8091:2252233925503221807
2023-09-11 17:47:06.878  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : transaction 192.168.2.126:8091:2252233925503221807 will be rollback
2023-09-11 17:47:07.105  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : transaction end, xid = 192.168.2.126:8091:2252233925503221807
2023-09-11 17:47:07.105  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : [192.168.2.126:8091:2252233925503221807] rollback status: Rollbacked

库存模块(stock-tcc)

2023-09-11 17:47:06.676  INFO 22560 --- [nio-8181-exec-1] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221807, branchId:2252233925503221809, lockKeys:null
2023-09-11 17:47:06.690  INFO 22560 --- [nio-8181-exec-1] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221809
2023-09-11 17:47:06.694  INFO 22560 --- [nio-8181-exec-1] s.z.e.tccaction.impl.StockActionImpl     : deduct stock balance in transaction: 192.168.2.126:8091:2252233925503221807
2023-09-11 17:47:06.739  WARN 22560 --- [nio-8181-exec-1] c.a.c.seata.web.SeataHandlerInterceptor  : xid in change during RPC from 192.168.2.126:8091:2252233925503221807 to null
2023-09-11 17:47:07.035  INFO 22560 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:BranchRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221809, branchType=TCC, resourceId='tryDeduct', applicationData='{"actionContext":{"action-start-time":1694425626577,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}
2023-09-11 17:47:07.036  INFO 22560 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 192.168.2.126:8091:2252233925503221807 2252233925503221809 tryDeduct
2023-09-11 17:47:07.090  INFO 22560 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource rollback result : true, xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221809, resourceId: tryDeduct
2023-09-11 17:47:07.091  INFO 22560 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_Rollbacked

订单模块(order-tcc)

2023-09-11 17:47:06.771  INFO 24332 --- [nio-8282-exec-6] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221807, branchId:2252233925503221811, lockKeys:null
2023-09-11 17:47:06.779  INFO 24332 --- [nio-8282-exec-6] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221811
2023-09-11 17:47:06.779  INFO 24332 --- [nio-8282-exec-6] s.z.e.tccaction.impl.OrderActionImpl     : create order in transaction: 192.168.2.126:8091:2252233925503221807
java.lang.RuntimeException: Failed to call Account Service. at space.zlyx.example.tccaction.impl.OrderActionImpl.tryCreate(OrderActionImpl.java:48)at space.zlyx.example.tccaction.impl.OrderActionImpl$$FastClassBySpringCGLIB$$180ddab3.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)at io.seata.rm.tcc.TCCFenceHandler.lambda$prepareFence$0(TCCFenceHandler.java:115)at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)at io.seata.rm.tcc.TCCFenceHandler.prepareFence(TCCFenceHandler.java:109)at io.seata.rm.tcc.interceptor.ActionInterceptorHandler.proceed(ActionInterceptorHandler.java:94)at io.seata.spring.tcc.TccActionInterceptor.invoke(TccActionInterceptor.java:100)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)at space.zlyx.example.tccaction.impl.OrderActionImpl$$EnhancerBySpringCGLIB$$a5c94c21.tryCreate(<generated>)at space.zlyx.example.service.OrderService.create(OrderService.java:21)at space.zlyx.example.controller.OrderController.create(OrderController.java:22)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:748)
2023-09-11 17:47:06.877  WARN 24332 --- [nio-8282-exec-6] c.a.c.seata.web.SeataHandlerInterceptor  : xid in change during RPC from 192.168.2.126:8091:2252233925503221807 to null
2023-09-11 17:47:06.980  INFO 24332 --- [h_RMROLE_1_5_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:BranchRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221811, branchType=TCC, resourceId='tryCreate', applicationData='{"actionContext":{"action-start-time":1694425626742,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}
2023-09-11 17:47:06.982  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 192.168.2.126:8091:2252233925503221807 2252233925503221811 tryCreate
2023-09-11 17:47:07.006  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.tcc.TCCFenceHandler          : Insert tcc fence record result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221811
2023-09-11 17:47:07.017  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractResourceManager      : TCC resource rollback result : true, xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221811, resourceId: tryCreate
2023-09-11 17:47:07.017  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_Rollbacked

账户模块(account-tcc)

2023-09-11 17:47:06.805  INFO 21608 --- [nio-8383-exec-6] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221807, branchId:2252233925503221813, lockKeys:null
2023-09-11 17:47:06.829  INFO 21608 --- [nio-8383-exec-6] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221813
2023-09-11 17:47:06.829  INFO 21608 --- [nio-8383-exec-6] s.z.e.tccaction.impl.AccountActionImpl   : reduce account balance in transaction: 192.168.2.126:8091:2252233925503221807
2023-09-11 17:47:06.833  INFO 21608 --- [nio-8383-exec-6] s.z.e.tccaction.impl.AccountActionImpl   : balance after transaction: -2000
java.lang.RuntimeException: Not Enough Money ...at space.zlyx.example.tccaction.impl.AccountActionImpl.tryReduce(AccountActionImpl.java:36)at space.zlyx.example.tccaction.impl.AccountActionImpl$$FastClassBySpringCGLIB$$486c7b12.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)at io.seata.rm.tcc.TCCFenceHandler.lambda$prepareFence$0(TCCFenceHandler.java:115)at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)at io.seata.rm.tcc.TCCFenceHandler.prepareFence(TCCFenceHandler.java:109)at io.seata.rm.tcc.interceptor.ActionInterceptorHandler.proceed(ActionInterceptorHandler.java:94)at io.seata.spring.tcc.TccActionInterceptor.invoke(TccActionInterceptor.java:100)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)at space.zlyx.example.tccaction.impl.AccountActionImpl$$EnhancerBySpringCGLIB$$86f696ad.tryReduce(<generated>)at space.zlyx.example.service.AccountService.reduce(AccountService.java:23)at space.zlyx.example.controller.AccountController.reduce(AccountController.java:22)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:748)
2023-09-11 17:47:06.855  WARN 21608 --- [nio-8383-exec-6] c.a.c.seata.web.SeataHandlerInterceptor  : xid in change during RPC from 192.168.2.126:8091:2252233925503221807 to null
2023-09-11 17:47:06.922  INFO 21608 --- [h_RMROLE_1_5_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:BranchRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221813, branchType=TCC, resourceId='tryReduce', applicationData='{"actionContext":{"action-start-time":1694425626784,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}
2023-09-11 17:47:06.924  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 192.168.2.126:8091:2252233925503221807 2252233925503221813 tryReduce
2023-09-11 17:47:06.937  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.tcc.TCCFenceHandler          : Insert tcc fence record result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221813
2023-09-11 17:47:06.960  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractResourceManager      : TCC resource rollback result : true, xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221813, resourceId: tryReduce
2023-09-11 17:47:06.960  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_Rollbacked

Rollback 调用流程 Server 端控制台输出

17:47:06.423  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalBeginRequest{transactionName='purchase(java.lang.String, java.lang.String, int, boolean)', timeout=60000}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.442  INFO --- [verHandlerThread_1_24_500] [coordinator.DefaultCoordinator] [       doGlobalBegin]  [192.168.2.126:8091:2252233925503221807] : Begin new global transaction applicationId: business-tcc,transactionServiceGroup: my_test_tx_group, transactionName: purchase(java.lang.String, java.lang.String, int, boolean),timeout:60000,xid:192.168.2.126:8091:2252233925503221807
17:47:06.442  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalBeginResponse{xid='192.168.2.126:8091:2252233925503221807', extraData='null', resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.648  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221807', branchType=TCC, resourceId='tryDeduct', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694425626577,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.669  INFO --- [nPool.commonPool-worker-4] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221807] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221807, branchId = 2252233925503221809, resourceId = tryDeduct ,lockKeys = null
17:47:06.670  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221809, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.743  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221807', branchType=TCC, resourceId='tryCreate', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694425626742,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.770  INFO --- [nPool.commonPool-worker-4] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221807] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221807, branchId = 2252233925503221811, resourceId = tryCreate ,lockKeys = null
17:47:06.770  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221811, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.787  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221807', branchType=TCC, resourceId='tryReduce', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694425626784,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.804  INFO --- [nPool.commonPool-worker-4] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221807] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221807, branchId = 2252233925503221813, resourceId = tryReduce ,lockKeys = null
17:47:06.804  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221813, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.879  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', extraData='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.963  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221813, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.977  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [192.168.2.126:8091:2252233925503221807] : Rollback branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221807 branchId = 2252233925503221813
17:47:07.020  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221811, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:07.031  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [192.168.2.126:8091:2252233925503221807] : Rollback branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221807 branchId = 2252233925503221811
17:47:07.094  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221809, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:07.104  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [192.168.2.126:8091:2252233925503221807] : Rollback branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221807 branchId = 2252233925503221809
17:47:07.104  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [    doGlobalRollback]  [192.168.2.126:8091:2252233925503221807] : Rollback global transaction successfully, xid = 192.168.2.126:8091:2252233925503221807.
17:47:07.105  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalRollbackResponse{globalStatus=Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group

按时序整理的完整流程输出(包含Client 端、Server 端)

17:47:06.423  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalBeginRequest{transactionName='purchase(java.lang.String, java.lang.String, int, boolean)', timeout=60000}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.442  INFO --- [verHandlerThread_1_24_500] [coordinator.DefaultCoordinator] [       doGlobalBegin]  [192.168.2.126:8091:2252233925503221807] : Begin new global transaction applicationId: business-tcc,transactionServiceGroup: my_test_tx_group, transactionName: purchase(java.lang.String, java.lang.String, int, boolean),timeout:60000,xid:192.168.2.126:8091:2252233925503221807
17:47:06.442  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalBeginResponse{xid='192.168.2.126:8091:2252233925503221807', extraData='null', resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:06.443  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : Begin new global transaction [192.168.2.126:8091:2252233925503221807]
17:47:06.443  INFO 24792 --- [nio-8484-exec-7] s.zlyx.example.service.BusinessService   : New Transaction Begins: 192.168.2.126:8091:225223392550322180717:47:06.648  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221807', branchType=TCC, resourceId='tryDeduct', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694425626577,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.669  INFO --- [nPool.commonPool-worker-4] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221807] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221807, branchId = 2252233925503221809, resourceId = tryDeduct ,lockKeys = null
17:47:06.670  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221809, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:06.676  INFO 22560 --- [nio-8181-exec-1] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221807, branchId:2252233925503221809, lockKeys:null
17:47:06.690  INFO 22560 --- [nio-8181-exec-1] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221809
17:47:06.694  INFO 22560 --- [nio-8181-exec-1] s.z.e.tccaction.impl.StockActionImpl     : deduct stock balance in transaction: 192.168.2.126:8091:225223392550322180717:47:06.743  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221807', branchType=TCC, resourceId='tryCreate', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694425626742,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.770  INFO --- [nPool.commonPool-worker-4] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221807] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221807, branchId = 2252233925503221811, resourceId = tryCreate ,lockKeys = null
17:47:06.770  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221811, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:06.771  INFO 24332 --- [nio-8282-exec-6] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221807, branchId:2252233925503221811, lockKeys:null
17:47:06.779  INFO 24332 --- [nio-8282-exec-6] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221811
17:47:06.779  INFO 24332 --- [nio-8282-exec-6] s.z.e.tccaction.impl.OrderActionImpl     : create order in transaction: 192.168.2.126:8091:225223392550322180717:47:06.787  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.126:8091:2252233925503221807', branchType=TCC, resourceId='tryReduce', lockKey='null', applicationData='{"actionContext":{"action-start-time":1694425626784,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.804  INFO --- [nPool.commonPool-worker-4] [erver.coordinator.AbstractCore] [bda$branchRegister$0]  [192.168.2.126:8091:2252233925503221807] : Register branch successfully, xid = 192.168.2.126:8091:2252233925503221807, branchId = 2252233925503221813, resourceId = tryReduce ,lockKeys = null
17:47:06.804  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[merged]: BranchRegisterResponse{branchId=2252233925503221813, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:06.805  INFO 21608 --- [nio-8383-exec-6] io.seata.rm.AbstractResourceManager      : branch register success, xid:192.168.2.126:8091:2252233925503221807, branchId:2252233925503221813, lockKeys:null
17:47:06.829  INFO 21608 --- [nio-8383-exec-6] io.seata.rm.tcc.TCCFenceHandler          : TCC fence prepare result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221813
17:47:06.829  INFO 21608 --- [nio-8383-exec-6] s.z.e.tccaction.impl.AccountActionImpl   : reduce account balance in transaction: 192.168.2.126:8091:2252233925503221807
17:47:06.833  INFO 21608 --- [nio-8383-exec-6] s.z.e.tccaction.impl.AccountActionImpl   : balance after transaction: -200017:47:06.878  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : transaction 192.168.2.126:8091:2252233925503221807 will be rollback17:47:06.879  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: GlobalRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', extraData='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:06.922  INFO 21608 --- [h_RMROLE_1_5_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:BranchRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221813, branchType=TCC, resourceId='tryReduce', applicationData='{"actionContext":{"action-start-time":1694425626784,"useTCCFence":true,"money":3000,"sys::prepare":"tryReduce","sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryReduce"}}'}
17:47:06.924  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 192.168.2.126:8091:2252233925503221807 2252233925503221813 tryReduce
17:47:06.937  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.tcc.TCCFenceHandler          : Insert tcc fence record result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221813
17:47:06.960  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractResourceManager      : TCC resource rollback result : true, xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221813, resourceId: tryReduce
17:47:06.960  INFO 21608 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_Rollbacked17:47:06.963  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221813, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:06.977  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [192.168.2.126:8091:2252233925503221807] : Rollback branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221807 branchId = 225223392550322181317:47:06.980  INFO 24332 --- [h_RMROLE_1_5_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:BranchRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221811, branchType=TCC, resourceId='tryCreate', applicationData='{"actionContext":{"action-start-time":1694425626742,"useTCCFence":true,"sys::prepare":"tryCreate","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","userId":"U100000","actionName":"tryCreate"}}'}
17:47:06.982  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 192.168.2.126:8091:2252233925503221807 2252233925503221811 tryCreate
17:47:07.006  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.tcc.TCCFenceHandler          : Insert tcc fence record result: true. xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221811
17:47:07.017  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractResourceManager      : TCC resource rollback result : true, xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221811, resourceId: tryCreate
17:47:07.017  INFO 24332 --- [h_RMROLE_1_5_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_Rollbacked17:47:07.020  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221811, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group
17:47:07.031  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [192.168.2.126:8091:2252233925503221807] : Rollback branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221807 branchId = 225223392550322181117:47:07.035  INFO 22560 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:BranchRollbackRequest{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221809, branchType=TCC, resourceId='tryDeduct', applicationData='{"actionContext":{"action-start-time":1694425626577,"useTCCFence":true,"sys::prepare":"tryDeduct","commodityCode":"C100000","count":30,"sys::rollback":"rollback","sys::commit":"commit","host-name":"192.168.2.126","actionName":"tryDeduct"}}'}
17:47:07.036  INFO 22560 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 192.168.2.126:8091:2252233925503221807 2252233925503221809 tryDeduct
17:47:07.090  INFO 22560 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractResourceManager      : TCC resource rollback result : true, xid: 192.168.2.126:8091:2252233925503221807, branchId: 2252233925503221809, resourceId: tryDeduct
17:47:07.091  INFO 22560 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_Rollbacked17:47:07.094  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : receive msg[single]: BranchRollbackResponse{xid='192.168.2.126:8091:2252233925503221807', branchId=2252233925503221809, branchStatus=PhaseTwo_Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:07.104  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [a$doGlobalRollback$3]  [192.168.2.126:8091:2252233925503221807] : Rollback branch transaction successfully, xid = 192.168.2.126:8091:2252233925503221807 branchId = 2252233925503221809
17:47:07.104  INFO --- [verHandlerThread_1_28_500] [server.coordinator.DefaultCore] [    doGlobalRollback]  [192.168.2.126:8091:2252233925503221807] : Rollback global transaction successfully, xid = 192.168.2.126:8091:2252233925503221807.17:47:07.105  INFO --- [     batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [                 run]  [] : result msg[single]: GlobalRollbackResponse{globalStatus=Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.126, vgroup: my_test_tx_group17:47:07.105  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : transaction end, xid = 192.168.2.126:8091:2252233925503221807
17:47:07.105  INFO 24792 --- [nio-8484-exec-7] i.seata.tm.api.DefaultGlobalTransaction  : [192.168.2.126:8091:2252233925503221807] rollback status: Rollbacked

(完)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/108774.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

格式化以后数据还在吗 格式化后数据怎么恢复

格式化是一种保护数据存储设备、清空部分不使用文件的操作方法&#xff0c;它能够对数据存储设备中的文件进行初始化。 但是如果格式化时不小心清空了重要的数据&#xff0c;可能会造成数据丢失的问题。今天&#xff0c;我将以格式化以后数据还在吗&#xff0c;格式化后数据怎么…

第三方电容笔怎么样?开学季平价电容笔排行榜

苹果的电容笔能得到那么多人的认可&#xff0c;主要还是得益于这款电容笔的出色性能&#xff0c;以及它特有的“重力压感”这个特有功能。不过苹果的原装电容笔&#xff0c;价格也不便宜&#xff0c;大部分人还是用了平价的平替电容笔。现在很多人都喜欢用ipad来画画或者做记录…

【C#-1】C#调用matlab生成的dll库

matlab打包dll 1、matlab示例程序&#xff1a; function untitled4(x)z peaks(x);figuresurf(z) end 2、输入deploytool打包matlab程序&#xff0c;具体如下&#xff1a; 3、拷贝 打包成功后&#xff0c;将生成for_redistribution_files_only文件夹中的dll文件拷贝到C#程序…

关于HTTP协议的概述

HTTP 的报文大概分为三大部分。第一部分是请求行&#xff0c;第二部分是请求的首部&#xff0c;第三部分才是请求的正文实体。 POST 往往是用来创建一个资源的&#xff0c;而 PUT 往往是用来修改一个资源的。 Accept-Charset&#xff0c;表示客户端可以接受的字符集。防止传过…

Redis常用应用场景

Redis是一款开源的基于内存的键值存储系统&#xff0c;它提供了多种数据结构和丰富的功能&#xff0c;适用于各种不同的应用场景。以下是Redis常用的应用场景&#xff1a; 1.缓存&#xff1a;Redis最常见的用途就是作为缓存。由于Redis存储在内存中&#xff0c;读取速度非常快…

CRC(循环冗余校验码的校验方法)

5个关键点&#xff1a; 1.信息码&#xff1a;即给出要校验的二进制码 2.生成多项式&#xff1a;一般多项式会给&#xff0c;从最高位的指数位数就可以得到有几个校验码&#xff1b;如果没给多项式&#xff0c;肯定会给个多项式二进制码&#xff0c;根据它来推就行&#xff08;…

Windows环境下Springboot3+Graalvm+Idea 打包成原生镜像 踩坑

https://github.com/oracle/graal/https://github.com/graalvm/graalvm-ce-builds/releases/对应关系graalvm-ce-java17-windows-amd64-X.X.X.zipnative-image-installable-svm-java17-windows-amd64-X.X.X.jar本人使用:graalvm-ce-java17-windows-amd64-23.0.1.zipnative-imag…

多元函数的微分法

目录 复合函数微分法 隐函数微分法 复合函数求导与全微分 隐函数偏导数与全微分 复合函数微分法 复合函数微分法是一种求导方法&#xff0c;用于计算复合函数的导数。 假设有一个复合函数yf(u)&#xff0c;其中ug(x)&#xff0c;则复合函数微分法可以用于计算y对x的导数。根…

win10win11截图技巧——不用安装其他截图工具或者运行其他截图工具,就可以截图,win10和win11可用

快捷键shift wins可以调出来windows自带的截图工具。 测试了一下win10和win11都可以用。 可以截图的方式有&#xff1a; 1&#xff0c;全屏截图&#xff0c; 2&#xff0c;窗口截图&#xff0c; 3&#xff0c;任意截图&#xff0c; 4&#xff0c;画矩形截图 以下内容来自…

【已解决】您所使用的密钥ak有问题,不支持jsapi服务,可以访问该网址了解如何获取有效密钥。

您所使用的密钥ak有问题&#xff0c;不支持jsapi服务&#xff0c;可以访问该网址了解如何获取有效密钥。详情查看&#xff1a;http://lbsyun.baidu.com/apiconsole/key#。 问题 百度密钥过期 思路 注册成为开发者 如果还没注册百度地图api账号的&#xff0c;点击以后就进入…

如果你想了解远程工作,这篇文章不容错过

大家好&#xff0c;好久不见&#xff0c;我好久都没写原创文章了。 最近周边的越来越多朋友来找我了解远程工作相关的问题&#xff0c;正好这个月也是我远程工作一年半了&#xff0c;所以就写篇文章聊聊关于这块的话题吧。 语言问题 首先远程工作基本分两种团队&#xff0c;一种…

【记录】Truenas scale|Truenas 的 SSH 服务连不上 VScode,终端能连上

一般 Truenas连不上 就只有两种情况&#xff1a; 第一种&#xff1a;用户没对应用户目录。需要去用户管理里面对每个用户设置目录。 第二种情况&#xff0c;服务有个选项没勾选。这时会发现能输入密码但是一点反应都没有&#xff0c;打开details会看到报错channel 3: open fai…