[seata]seata undo_log没有数据 global_table是有数据

2023-12-10 179 views
2

版本:

io.seata seata-spring-boot-starter 1.5.1

spring boot 1.5.8 JDK 8

服务a

image

服务b

image

server端日志

image

enable-auto-data-source-proxy: 设置true和false都不好使

回答

9

服务a的配置:

seata的配置 seata: enabled: true application-id: ${spring.application.name} tx-service-group: common-seata-service-group # 保持一致 enable-auto-data-source-proxy: true service: vgroupMapping: common-seata-service-group: seata-server # 保持一致 registry: type: eureka eureka: weight: 1 service-url: http://localhost:8761/eureka

服务b的配置: seata: enabled: true application-id: ${spring.application.name} tx-service-group: common-seata-service-group # 保持一致 enable-auto-data-source-proxy: true service: vgroupMapping: common-seata-service-group: seata-server # 保持一致 registry: type: eureka eureka: weight: 1 service-url: http://localhost:8761/eureka

0

根据你的日志来看,你的数据源没有正确被代理,或者说被代理后没有被你的事务框架所使用,导致无法加入全局事务,请检查你的代码,使datasourceproxy正确被事务管理器所使用

0

你的回滚日志中只有全局事务,而没有分支事务,很明显是数据源代理出现了问题或错误的使用

4
image

大佬,我看这个日志,两个服务seata都已经代理了,使用的是自己配置的方式

image

undo_log 还是没有数据

1

不要怀疑,你那个只是数据源代理的注册一个通信用的channel,而不是分支注册测试。你这个bean自行debug到底有没有被其他的事务管理器,sessionfactory之类的地方用到

7

谢谢大佬,是项目框架数据源代理的问题,现在使用TCC模式了,再次感谢大佬