seata1.3 在100并发下出现undo_log表里有遗留记录,同时有一些数据不一致。

hivapdat  于 2023-02-04  发布在  其他
关注(0)|答案(2)|浏览(711)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

环境:
spring-cloud-alibaba-dependencies 2.2.1.RELEASE
spring-cloud Hoxton.SR3
spring-boot 2.2.5.RELEASE
seata client&server 1.3
数据库 oracle
三个服务:order-service,storage-service,account-service
order-service负责触发全局事务
storage-service扣库存
account-service模拟跑出异常

所有配置都按照demo以及官网上配置好,
触发分布式事务的方法上已经加上:
@GlobalTransactional(rollbackFor = Exception.class)
并且其他各分支事务已经加上:

@Transactional(rollbackFor = Exception.class)
 @GlobalLock

启用了 enable-auto-data-source-proxy: true
每个分支事务用aop方式进行拦截回滚:

@Aspect
@Component
@Slf4j
public class Rollback {
    @Before("execution(* demo.seata.service..*.*(..))")
    public void before(JoinPoint joinpoint) throws TransactionException {
        MethodSignature signature = (MethodSignature) joinpoint.getSignature();
        final Method method = signature.getMethod();
        log.info("intercept methd: "+method.getName());
    }

    @AfterThrowing(throwing = "e",pointcut = "execution(* demo.seata.service..*.*(..)))")
    public void rollback(Throwable e) throws  TransactionException{
        log.info("method call exception: "+e.getMessage());
        if (!StringUtils.isEmpty(RootContext.getXID())){
            GlobalTransactionContext.reload(RootContext.getXID()).rollback();
        }
    }

}

并且分支事务在事务中已经加上 for update

在低并发下一切ok,但是高于100并发,storage-service就出现如下情况:
storage-service分支事务出现异常:

org.springframework.transaction.TransactionSystemException: Could not commit JDBC transaction; nested exception is java.sql.SQLException: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = 10.101.9.60:8091:94372340665683968, may be has finished.] ]
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:334) ~[spring-jdbc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:743) ~[spring-tx-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:711) ~[spring-tx-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:631) ~[spring-tx-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:385) ~[spring-tx-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at io.seata.spring.annotation.GlobalTransactionalInterceptor.lambda$handleGlobalLock$0(GlobalTransactionalInterceptor.java:134) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.GlobalLockTemplate.execute(GlobalLockTemplate.java:48) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalLock(GlobalTransactionalInterceptor.java:132) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:124) ~[seata-all-1.3.0.jar!/:1.3.0]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at storage.service.StorageService$$EnhancerBySpringCGLIB$$162a8702.subNum(<generated>) ~[classes!/:na]
	at storage.controller.StorageController.subStorage(StorageController.java:31) ~[classes!/:na]
	at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_271]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_271]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:109) [spring-boot-actuator-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_271]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_271]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_271]
Caused by: java.sql.SQLException: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = 10.101.9.60:8091:94372340665683968, may be has finished.] ]
	at io.seata.rm.datasource.ConnectionProxy.recognizeLockKeyConflictException(ConnectionProxy.java:157) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:218) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy.doCommit(ConnectionProxy.java:196) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy.lambda$commit$0(ConnectionProxy.java:184) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.execute(ConnectionProxy.java:289) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:183) ~[seata-all-1.3.0.jar!/:1.3.0]
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:331) ~[spring-jdbc-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
	... 72 common frames omitted
Caused by: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = 10.101.9.60:8091:94372340665683968, may be has finished.] ]
	at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:69) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy.register(ConnectionProxy.java:238) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:216) ~[seata-all-1.3.0.jar!/:1.3.0]
	... 77 common frames omitted

2021-01-18 10:02:10.373 WARN 51337 --- [io-8083-exec-17] i.s.r.d.exec.SelectForUpdateExecutor : oracle does not support release save point, but this is not a error.

vh0rcniy

vh0rcniy1#

undo_log表里残留记录:

并且rollback_info字段的值如下:

wa7juj8i

wa7juj8i2#

undo_log里大部分记录的rollback_info字段值都是"{}"
有的是这样:

{"@class":"io.seata.rm.datasource.undo.BranchUndoLog","xid":"10.101.9.60:8091:94372492155555840","branchId":94372492247830529,"sqlUndoLogs":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.undo.SQLUndoLog","sqlType":"INSERT","tableName":"T_ORDER","beforeImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords$EmptyTableRecords","tableName":"T_ORDER","rows":["java.util.ArrayList",[]]},"afterImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords","tableName":"T_ORDER","rows":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.sql.struct.Row","fields":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"ID","keyType":"PRIMARY_KEY","type":2,"value":["java.math.BigDecimal",26888]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"USER_ID","keyType":"NULL","type":2,"value":["java.math.BigDecimal",1]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"PRODUCT_ID","keyType":"NULL","type":2,"value":["java.math.BigDecimal",1]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"AMOUNT","keyType":"NULL","type":2,"value":["java.math.BigDecimal",1]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"MONTY","keyType":"NULL","type":2,"value":["java.math.BigDecimal",10]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"STATUS","keyType":"NULL","type":2,"value":["java.math.BigDecimal",1]}]]}]]}}]]}

还有的是这样:

{"@class":"io.seata.rm.datasource.undo.BranchUndoLog","xid":"10.101.9.60:8091:94372492155555840","branchId":94372505426333697,"sqlUndoLogs":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.undo.SQLUndoLog","sqlType":"UPDATE","tableName":"T_STORAGE","beforeImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords","tableName":"T_STORAGE","rows":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.sql.struct.Row","fields":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"ID","keyType":"PRIMARY_KEY","type":2,"value":["java.math.BigDecimal",1]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"AMOUNT","keyType":"NULL","type":2,"value":["java.math.BigDecimal",97]}]]}]]},"afterImage":{"@class":"io.seata.rm.datasource.sql.struct.TableRecords","tableName":"T_STORAGE","rows":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.sql.struct.Row","fields":["java.util.ArrayList",[{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"ID","keyType":"PRIMARY_KEY","type":2,"value":["java.math.BigDecimal",1]},{"@class":"io.seata.rm.datasource.sql.struct.Field","name":"AMOUNT","keyType":"NULL","type":2,"value":["java.math.BigDecimal",96]}]]}]]}}]]}

对应的t_order表有一笔没有回滚的记录:

而t_storage表里是正常的:

同时控制台不断有重试日志:

2021-01-18 10:25:50.201  INFO 51337 --- [_RMROLE_1_12_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2021-01-18 10:25:51.186  INFO 51337 --- [_RMROLE_1_13_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:xid=10.101.9.60:8091:94372492155555840,branchId=94372505426333697,branchType=AT,resourceId=jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb,applicationData=null
2021-01-18 10:25:51.187  INFO 51337 --- [_RMROLE_1_13_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 10.101.9.60:8091:94372492155555840 94372505426333697 jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb
2021-01-18 10:25:51.198  INFO 51337 --- [_RMROLE_1_13_16] i.s.r.d.undo.AbstractUndoExecutor        : Field not equals, name AMOUNT, old value 96, new value 100
2021-01-18 10:25:51.242  INFO 51337 --- [_RMROLE_1_13_16] i.seata.rm.datasource.DataSourceManager  : branchRollback failed. branchType:[AT], xid:[10.101.9.60:8091:94372492155555840], branchId:[94372505426333697], resourceId:[jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb], applicationData:[null]. reason:[Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.]
2021-01-18 10:25:51.242  INFO 51337 --- [_RMROLE_1_13_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2021-01-18 10:25:52.184  INFO 51337 --- [_RMROLE_1_14_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:xid=10.101.9.60:8091:94372492155555840,branchId=94372505426333697,branchType=AT,resourceId=jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb,applicationData=null
2021-01-18 10:25:52.184  INFO 51337 --- [_RMROLE_1_14_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 10.101.9.60:8091:94372492155555840 94372505426333697 jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb
2021-01-18 10:25:52.192  INFO 51337 --- [_RMROLE_1_14_16] i.s.r.d.undo.AbstractUndoExecutor        : Field not equals, name AMOUNT, old value 96, new value 100
2021-01-18 10:25:52.209  INFO 51337 --- [_RMROLE_1_14_16] i.seata.rm.datasource.DataSourceManager  : branchRollback failed. branchType:[AT], xid:[10.101.9.60:8091:94372492155555840], branchId:[94372505426333697], resourceId:[jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb], applicationData:[null]. reason:[Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.]
2021-01-18 10:25:52.209  INFO 51337 --- [_RMROLE_1_14_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2021-01-18 10:25:53.183  INFO 51337 --- [_RMROLE_1_15_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:xid=10.101.9.60:8091:94372492155555840,branchId=94372505426333697,branchType=AT,resourceId=jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb,applicationData=null
2021-01-18 10:25:53.183  INFO 51337 --- [_RMROLE_1_15_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 10.101.9.60:8091:94372492155555840 94372505426333697 jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb
2021-01-18 10:25:53.188  INFO 51337 --- [_RMROLE_1_15_16] i.s.r.d.undo.AbstractUndoExecutor        : Field not equals, name AMOUNT, old value 96, new value 100
2021-01-18 10:25:53.200  INFO 51337 --- [_RMROLE_1_15_16] i.seata.rm.datasource.DataSourceManager  : branchRollback failed. branchType:[AT], xid:[10.101.9.60:8091:94372492155555840], branchId:[94372505426333697], resourceId:[jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb], applicationData:[null]. reason:[Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.]
2021-01-18 10:25:53.200  INFO 51337 --- [_RMROLE_1_15_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2021-01-18 10:25:54.188  INFO 51337 --- [_RMROLE_1_16_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:xid=10.101.9.60:8091:94372492155555840,branchId=94372505426333697,branchType=AT,resourceId=jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb,applicationData=null
2021-01-18 10:25:54.188  INFO 51337 --- [_RMROLE_1_16_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 10.101.9.60:8091:94372492155555840 94372505426333697 jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb
2021-01-18 10:25:54.204  INFO 51337 --- [_RMROLE_1_16_16] i.s.r.d.undo.AbstractUndoExecutor        : Field not equals, name AMOUNT, old value 96, new value 100
2021-01-18 10:25:54.217  INFO 51337 --- [_RMROLE_1_16_16] i.seata.rm.datasource.DataSourceManager  : branchRollback failed. branchType:[AT], xid:[10.101.9.60:8091:94372492155555840], branchId:[94372505426333697], resourceId:[jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb], applicationData:[null]. reason:[Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.]
2021-01-18 10:25:54.217  INFO 51337 --- [_RMROLE_1_16_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2021-01-18 10:25:55.188  INFO 51337 --- [h_RMROLE_1_1_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:xid=10.101.9.60:8091:94372492155555840,branchId=94372505426333697,branchType=AT,resourceId=jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb,applicationData=null
2021-01-18 10:25:55.188  INFO 51337 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 10.101.9.60:8091:94372492155555840 94372505426333697 jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb
2021-01-18 10:25:55.196  INFO 51337 --- [h_RMROLE_1_1_16] i.s.r.d.undo.AbstractUndoExecutor        : Field not equals, name AMOUNT, old value 96, new value 100
2021-01-18 10:25:55.210  INFO 51337 --- [h_RMROLE_1_1_16] i.seata.rm.datasource.DataSourceManager  : branchRollback failed. branchType:[AT], xid:[10.101.9.60:8091:94372492155555840], branchId:[94372505426333697], resourceId:[jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb], applicationData:[null]. reason:[Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.]
2021-01-18 10:25:55.210  INFO 51337 --- [h_RMROLE_1_1_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacked result: PhaseTwo_RollbackFailed_Retryable
2021-01-18 10:25:56.185  INFO 51337 --- [h_RMROLE_1_2_16] i.s.c.r.p.c.RmBranchRollbackProcessor    : rm handle branch rollback process:xid=10.101.9.60:8091:94372492155555840,branchId=94372505426333697,branchType=AT,resourceId=jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb,applicationData=null
2021-01-18 10:25:56.186  INFO 51337 --- [h_RMROLE_1_2_16] io.seata.rm.AbstractRMHandler            : Branch Rollbacking: 10.101.9.60:8091:94372492155555840 94372505426333697 jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb
2021-01-18 10:25:56.194  INFO 51337 --- [h_RMROLE_1_2_16] i.s.r.d.undo.AbstractUndoExecutor        : Field not equals, name AMOUNT, old value 96, new value 100
2021-01-18 10:25:56.210  INFO 51337 --- [h_RMROLE_1_2_16] i.seata.rm.datasource.DataSourceManager  : [stacktrace]branchRollback failed. branchType:[[AT, 10.101.9.60:8091:94372492155555840, 94372505426333697, jdbc:oracle:thin:@//192.168.1.2:1521/demo/demodb, null, Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.]], xid:[{}], branchId:[{}], resourceId:[{}], applicationData:[{}]. reason:[{}]

io.seata.core.exception.BranchTransactionException: Branch session rollback failed and try again later xid = 10.101.9.60:8091:94372492155555840 branchId = 94372505426333697 Has dirty records when undo.
	at io.seata.rm.datasource.undo.AbstractUndoLogManager.undo(AbstractUndoLogManager.java:339) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.DataSourceManager.branchRollback(DataSourceManager.java:178) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.AbstractRMHandler.doBranchRollback(AbstractRMHandler.java:125) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.AbstractRMHandler$2.execute(AbstractRMHandler.java:67) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.AbstractRMHandler$2.execute(AbstractRMHandler.java:63) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:116) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.AbstractRMHandler.handle(AbstractRMHandler.java:63) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.DefaultRMHandler.handle(DefaultRMHandler.java:63) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.core.protocol.transaction.BranchRollbackRequest.handle(BranchRollbackRequest.java:35) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.AbstractRMHandler.onRequest(AbstractRMHandler.java:150) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.core.rpc.processor.client.RmBranchRollbackProcessor.handleBranchRollback(RmBranchRollbackProcessor.java:63) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.core.rpc.processor.client.RmBranchRollbackProcessor.process(RmBranchRollbackProcessor.java:58) [seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.core.rpc.netty.AbstractNettyRemoting.lambda$processMessage$2(AbstractNettyRemoting.java:265) [seata-all-1.3.0.jar!/:1.3.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_271]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_271]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.45.Final.jar!/:4.1.45.Final]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_271]
Caused by: java.sql.SQLException: Has dirty records when undo.
	at io.seata.rm.datasource.undo.AbstractUndoExecutor.dataValidationAndGoOn(AbstractUndoExecutor.java:268) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.undo.AbstractUndoExecutor.executeOn(AbstractUndoExecutor.java:116) ~[seata-all-1.3.0.jar!/:1.3.0]
	at io.seata.rm.datasource.undo.AbstractUndoLogManager.undo(AbstractUndoLogManager.java:291) ~[seata-all-1.3.0.jar!/:1.3.0]
	... 16 common frames omitted

相关问题