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

news2024/11/23 18:10:37

文章目录

    • 前言
    • 参考目录
    • 版本说明
    • 前置知识
      • 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_group

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]
16:07:42.717  INFO 24792 --- [nio-8484-exec-1] s.zlyx.example.service.BusinessService   : New Transaction Begins: 192.168.2.126:8091:2252233925503221763

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: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: 70

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.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:2252233925503221763

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.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: 7000

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

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.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_Committed

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.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_Committed

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.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_Committed

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

16: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_group

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]
17:47:06.443  INFO 24792 --- [nio-8484-exec-7] s.zlyx.example.service.BusinessService   : New Transaction Begins: 192.168.2.126:8091:2252233925503221807

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.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:2252233925503221807

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.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:2252233925503221807

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.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: -2000

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

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.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_Rollbacked

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: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_Rollbacked

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.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_Rollbacked

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

17: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.coloradmin.cn/o/1009795.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【华为云云耀云服务器L实例评测|使用教学】一文带你快速入手华为云云耀云服务器L实例

&#x1f935;‍♂️ 个人主页: AI_magician &#x1f4e1;主页地址&#xff1a; 作者简介&#xff1a;CSDN内容合伙人&#xff0c;全栈领域优质创作者。 &#x1f468;‍&#x1f4bb;景愿&#xff1a;旨在于能和更多的热爱计算机的伙伴一起成长&#xff01;&#xff01;&…

DC/DC开关电源学习笔记(七)低压大电流DC/DC变换技术

低压大电流DC/DC变换技术 1. 无暂态要求的低压大电流DC/DC变换技术2. 负载极其快速变化的低压大电流DC/DC变换技术2.1 非隔离型 VRM2.2 隔离型VRM低压大电流高功率 DC/DC 变换技术,已从前些年的 3.3V 降至现在的 1.0V 左右,电流目前已可达到几十安至几百安。同时,电源的输出指标…

使用CFimagehost源码搭建免费的PHP图片托管私人图床,无需数据库支持

文章目录 1.前言2. CFImagehost网站搭建2.1 CFImagehost下载和安装2.2 CFImagehost网页测试2.3 cpolar的安装和注册 3.本地网页发布3.1 Cpolar临时数据隧道3.2 Cpolar稳定隧道&#xff08;云端设置&#xff09;3.3.Cpolar稳定隧道&#xff08;本地设置&#xff09; 4.公网访问测…

vue3+scss开启写轮眼

vue3scss开启写轮眼 一、相关技术二、使用步骤1.安装依赖2.眼球3 勾玉4 旋转动画5 综合 一、相关技术 采用vue3vitescss的技术内容进行开发 二、使用步骤 1.安装依赖 代码如下&#xff1a; npm install sass2.眼球 首先我们根据需要 将眼睛的基础形状描绘出来&#xff0c…

【AI+医疗】AI在医疗影像设备工作周期中的应用探索

导读 随着人工智能技术的飞速发展&#xff0c;越来越多的领域开始与人工智能技术深度融合&#xff0c;产生了一种新型的技术模式——AI。AI是指将人工智能技术与其他领域的技术或应用进行结合&#xff0c;在提高效率、精度和创新能力的同时&#xff0c;也为人工智能技术的发展提…

The Sandbox 和 Burrito 钱包达成合作!

我们很高兴宣布与 Burrito 钱包达成合作&#xff0c;这是韩国领先的区块链公司 Rotonda 推出的一款全新的 Web3 钱包。此次合作旨在丰富 The Sandbox 平台的用户体验&#xff0c;实现更无缝的资产管理和转移。 此次合作的主要优势之一是将 Burrito 钱包集成到 The Sandbox 生态…

功率放大器的作用有哪些

功率放大器是电子设备中常见的一个组件&#xff0c;其作用是将输入信号的能量放大到更高的功率级别&#xff0c;以用于驱动高功率负载或者提供足够的功率来满足特定需求。功率放大器在各种应用领域中发挥着重要作用&#xff0c;下面将详细介绍功率放大器的作用与应用。 图&…

【【萌新编写RiscV之经典计算机组成与设计RISCV书记录 总4】】

萌新编写RiscV之经典计算机组成与设计RISCV书记录 总4 其实我一开始不想做这个因为实在是实现的功能复杂 但是都差不多的逻辑 基本目的 实现下列操作 条件分支指令branch if equal (beq)。 算术逻辑指令 add sub and or 条件分支指令branch if equal (beq)。 我们确定一下CP…

最新ChatGPT网站源码+支持GPT4.0+支持Midjourney绘画+支持国内全AI模型

一、智能创作系统 SparkAi创作系统是基于国外很火的ChatGPT进行开发的Ai智能问答系统。本期针对源码系统整体测试下来非常完美&#xff0c;可以说SparkAi是目前国内一款的ChatGPT对接OpenAI软件系统。那么如何搭建部署AI创作ChatGPT&#xff1f;小编这里写一个详细图文教程吧&…

【MySQL从删库到跑路 | 基础第二篇】——谈谈SQL中的DML语句

个人主页&#xff1a;兜里有颗棉花糖 欢迎 点赞&#x1f44d; 收藏✨ 留言✉ 加关注&#x1f493;本文由 兜里有颗棉花糖 原创 收录于专栏【MySQL学习专栏】&#x1f388; 本专栏旨在分享学习MySQL的一点学习心得&#xff0c;欢迎大家在评论区讨论&#x1f48c; 前言 前面我们…

华为Mate 60难以撼动苹果的市场份额

来源&#xff1a;猛兽财经 作者&#xff1a;猛兽财经 总结&#xff1a; &#xff08;1&#xff09;一些分析师认为&#xff0c;如果华为能够大规模生产Mate 60&#xff0c;那么华为的新智能手机将对苹果的市场份额构成威胁。 &#xff08;2&#xff09;还有消息称中国将禁止某…

【Node.js】模块化:

文章目录 1、模块化的基本概念2、Node.js 中模块化【1】Node.js 中模块的分类【2】加载模块【3】模块作用域【4】向外共享模块作用域中的成员【5】模块化规范 3、npm与包&#xff08;包/依赖/插件&#xff09;【1】包的基本知识&#xff1a;【2】开发属于自己的包【3】发布包 4…

在网站标题中使用可以让搜索引擎更容易(识别网站的主要内容)

随着互联网的飞速发展&#xff0c;越来越多的企业开始重视网站的优化。优化网站排名不仅可以增加曝光率和点击率&#xff0c;也可以提高品牌知名度和销售额。本文将从关键字优化方案入手&#xff0c;为大家详细介绍如何提升网站排名。 什么是关键字&#xff1f; 关键字是指用…

ChatGPT 网站合集/NovelAI tag生成器/Novel资源大全

ChatGPT 网站合集 https://github.com/xx025/carrot NovelAI tag生成器 https://wolfchen.top/tag/ Novel资源大全 https://wolfchen.top/tag/doc.html 简单地说&#xff0c;Stable Diffusion被修改后做出了NovelAI&#xff0c;NovelAI离家出走便有了Naifu Naifu简单好上手&am…

Java多线程篇(2)——mesi与内存屏障与volatile

文章目录 CPU高速缓存高速缓存storeBufferinvalidate message queue JMM 内存屏障volatile CPU高速缓存 高速缓存 每个cpu核心都有自己的高速缓存&#xff0c;结构如下 有缓存必有一致性问题&#xff0c;CPU0和CPU1之间的缓存是如何保持一致的。比较常见的一种做法就是 MESI…

mysql convert函数 解决读取double为科学计数法问题

convert顾名思义就是转化&#xff0c; cast差不多 MySQL CONVERT() 函数 | 参考手册 为什么需要这个函数&#xff1f; mysql是弱类型的 where stringcol1 and intcol1 都行 会自动转化&#xff0c;那我为什么还要呢&#xff1f; mysql有个类型是double &#xff0c;基本没人…

第二本书交稿了

大家好&#xff0c;我是飞哥&#xff01; 就在刚刚&#xff0c;我把新书的markdown源文件提交给出版社老师了&#xff0c;也就是说新书正式交稿了&#xff01; 上一本咱们书咱们写的是Linux网络方面的&#xff0c;书名是《深入理解Linux网络》。 咱们这本书帮助很多之前惧怕内核…

美东一公司的郁闷面试题

说是题目可以用不同的语言&#xff0c;但是貌似 Java 是多线程的&#xff0c;用 Java 写肯定容易不少。 但&#xff0c;觉得这个题目用多线程简直是有点脱了裤子放屁。 完整题目内容 题目的网站内容如下&#xff1a; Please complete the following challenge in one of th…

使用这款免费的洗稿软件究竟是好还是坏

嘿&#xff0c;大家好&#xff01;今天&#xff0c;我们要聊一聊一个备受争议的话题&#xff1a;洗稿软件(147SEO改写软件)。这些软件声称可以帮助你在写作时省下不少功夫&#xff0c;但究竟是好还是坏呢&#xff1f; 咱们都知道&#xff0c;写作是一门艺术&#xff0c;也是一项…

华策影视AIGC工程师招聘; 百度大模型创业松;主流大语言模型的技术原理细节;AIGC Prompt的七个缺陷 | ShowMeAI日报

&#x1f440;日报&周刊合集 | &#x1f3a1;生产力工具与行业应用大全 | &#x1f9e1; 点赞关注评论拜托啦&#xff01; &#x1f3af; 华策影视AIGC工程师招聘&#xff0c;AIGC在「文娱领域」的真正落地 逛即刻时发现关注的AI博主 杨昌 发布了自己公司的招聘信息&#x…