Open junliudr opened 7 months ago
阿里云 drds 5.2.8-15827113 使用seata全局事务
https://www.cnblogs.com/myf008/p/14755248.html
这个错误是ttdl 抛出来的。跟seata无关吧。
我们这边的业务是先操作单表,然后操作分库表,这种情况也无法保证分区字段都是 是否在同一个库内把
The full stack is sent out 完整堆栈发出来
org.springframework.jdbc.UncategorizedSQLException:
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; java.sql.SQLException: [17b177740d2b9003-4][172.16.89.94:3306][orders]ERR-CODE: [TDDL-4603][ERR_ACCROSS_DB_TRANSACTION] Transaction accross db is not supported in current transaction policy, transaction node is: ORDERS_1581929754022RQAA_HVS4_0008, but this sql execute on: ORDER S_1581929754022RQAA_HVS4_0000.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2551) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5094) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994) ~[mysql-connector-java-5.1.38.jar:5.1.38]
at com.taobao.tddl.driver.proxy.PreparedStatementProxy.executeUpdate(PreparedStatementProxy.java:86) ~[tddl-driver-1.0.8-SNAPSHOT.jar!/:na]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2723) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.filter.FilterAdapter.preparedStatement_executeUpdate(FilterAdapter.java:1069) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeUpdate(FilterEventAdapter.java:491) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2721) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.filter.FilterAdapter.preparedStatement_executeUpdate(FilterAdapter.java:1069) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeUpdate(FilterEventAdapter.java:491) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2721) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeUpdate(PreparedStatementProxyImpl.java:158) ~[druid-1.0.28.jar:1.0.28]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:253) ~[druid-1.0.28.jar:1.0.28]
at io.seata.rm.datasource.undo.mysql.MySQLUndoLogManager.insertUndoLog(MySQLUndoLogManager.java:90) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.undo.mysql.MySQLUndoLogManager.insertUndoLogWithNormal(MySQLUndoLogManager.java:74) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.undo.polardbx.PolarDBXUndoLogManager.insertUndoLogWithNormal(PolarDBXUndoLogManager.java:42) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.undo.AbstractUndoLogManager.flushUndoLogs(AbstractUndoLogManager.java:245) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:255) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy.doCommit(ConnectionProxy.java:230) ~[seata-alall-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:255) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy.doCommit(ConnectionProxy.java:230) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy.lambda$commit$0(ConnectionProxy.java:188) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.execute(ConnectionProxy.java:344) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:187) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.lambda$executeAutoCommitTrue$2(AbstractDMLBaseExecutor.java:146) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.doRetryOnLockConflict(ConnectionProxy.java:356) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor$LockRetryPolicy.execute(AbstractDMLBaseExecutor.java:188) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.executeAutoCommitTrue(AbstractDMLBaseExecutor.java:144) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.AbstractDMLBaseExecutor.doExecute(AbstractDMLBaseExecutor.java:83) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.BaseTransactionalExecutor.execute(BaseTransactionalExecutor.java:124) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:153) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:60) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.rm.datasource.PreparedStatementProxy.execute(PreparedStatementProxy.java:55) ~[seata-all-1.8.0.jar:1.8.0]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) ~[mybatis-3.4.2.jar:3.4.2]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.4.2.jar:3.4.2]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.4.2.jar:3.4.2]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.4.2.jar:3.4.2]
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.4.2.jar:3.4.2]
at sun.reflect.GeneratedMethodAccessor353.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_242]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63) ~[mybatis-3.4.2.jar:3.4.2]
at com.sun.proxy.$Proxy226.update(Unknown Source) ~[na:na]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) ~[mybatis-3.4.2.jar:3.4.2]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) ~[mybatis-3.4.2.jar:3.4.2]
at sun.reflect.GeneratedMethodAccessor365.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_242]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) ~[mybatis-spring-1.3.1.jar:1.3.1]
at com.sun.proxy.$Proxy141.insert(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278) ~[mybatis-spring-1.3.1.jar:1.3.1]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57) ~[mybatis-3.4.2.jar:3.4.2]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.2.jar:3.4.2]
at com.sun.proxy.$Proxy166.insertSelective(Unknown Source) ~[na:na]
at MarketOrderService.syncMarketPayment(MarketOrderService.java:1552) ~[na:na]
at MarketOrderService$$FastClassBySpringCGLIB$$9e9cb16a.invoke(
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721) ~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at io.seata.spring.annotation.GlobalTransactionalInterceptor$2.execute(GlobalTransactionalInterceptor.java:208) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.tm.api.TransactionalTemplate.execute(TransactionalTemplate.java:128) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.spring.annotation.GlobalTransactionalInterceptor.handleGlobalTransaction(GlobalTransactionalInterceptor.java:205) ~[seata-all-1.8.0.jar:1.8.0]
at io.seata.spring.annotation.GlobalTransactionalInterceptor.invoke(GlobalTransactionalInterceptor.java:175) ~[seata-all-1.8.0.jar:1.8.0]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) ~[spring-aop-4.3.7.RELEASE.jar:4.3.7.RELEASE]
at MarketOrderService$$EnhancerBySpringCGLIB$$59da266e.syncMarketPayment(
at sun.reflect.GeneratedMethodAccessor670.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_242]
at com.taobao.hsf.remoting.provider.ReflectInvocationHandler.handleRequest0(ReflectInvocationHandler.java:83) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.remoting.provider.ReflectInvocationHandler.invoke(ReflectInvocationHandler.java:163) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf2dubbo.DubboServerFilterAsyncInvocationHandlerInterceptor$1.invoke(DubboServerFilterAsyncInvocationHandlerInterceptor.java:140) ~[hsf-service-dubbo-2.2.8.7-EDAS-1.jar!/:na]
at TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:38) ~[classes/:na]
at com.taobao.hsf2dubbo.DubboFilterUtil$1.invoke(DubboFilterUtil.java:67) ~[hsf-service-dubbo-2.2.8.7-EDAS-1.jar!/:na]
at com.navercorp.pinpoint.plugin.micro.service.auth.dubbo.alibaba.AuthProviderFilter.invoke(AuthProviderFilter.java:38) ~[pinpoint-microservice-plugin-1.7.0-SNAPSHOT.jar:na]
at com.taobao.hsf2dubbo.DubboFilterUtil$1.invoke(DubboFilterUtil.java:67) ~[hsf-service-dubbo-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf2dubbo.DubboServerFilterAsyncInvocationHandlerInterceptor.invoke(DubboServerFilterAsyncInvocationHandlerInterceptor.java:63) ~[hsf-service-dubbo-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterBuilder$TailNode.invoke(RPCFilterBuilder.java:165) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.plugins.spas.SpasServerFilter.invoke(SpasServerFilter.java:127) ~[hsf-feature-spas-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.edas.tps.component.WhiteListServerFilter.invoke(WhiteListServerFilter.java:67) ~[hsf-feature-edas-tps-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.edas.tps.component.TPSServerFilter.invoke(TPSServerFilter.java:67) ~[hsf-feature-edas-tps-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.tps.component.TPSServerFilter.invoke(TPSServerFilter.java:68) ~[hsf-feature-tps-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.stats.InvocationStatsServerFilter.invoke(InvocationStatsServerFilter.java:47) ~[hsf-feature-invocation-stats-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.monitor.log.filter.MonitorLogServerFilter.invoke(MonitorLogServerFilter.java:45) ~[hsf-feature-monitor-log-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.profiler.ProfilerServerFilter.invoke(ProfilerServerFilter.java:32) ~[hsf-feature-profiler-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.plugins.eagleeye.EagleEyeServerFilter.invoke(EagleEyeServerFilter.java:68) ~[hsf-feature-eagleeye-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.rpc.server.MethodAbsenceFilter.invoke(MethodAbsenceFilter.java:48) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.rpc.server.EchoFilter.invoke(EchoFilter.java:45) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.rpc.generic.GenericInvocationServerFilter.invoke(GenericInvocationServerFilter.java:107) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf2dubbo.DubboGenericServerFilter.invoke(DubboGenericServerFilter.java:37) ~[hsf-service-dubbo-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.rpc.server.ServiceAbsenceFilter.invoke(ServiceAbsenceFilter.java:47) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.common.filter.CommonServerFilter.invoke(CommonServerFilter.java:24) ~[hsf-feature-common-filter-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf2dubbo.context.DubboRPCContextServerFilter.invoke(DubboRPCContextServerFilter.java:48) ~[hsf-service-dubbo-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.context.RPCContextServerFilter.invoke(RPCContextServerFilter.java:39) ~[hsf-feature-context-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterNode.invoke(RPCFilterNode.java:71) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.RPCFilterBuilder$HeadNode.invoke(RPCFilterBuilder.java:134) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.invocation.filter.FilterInvocationHandler.invoke(FilterInvocationHandler.java:28) ~[hsf-core-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.remoting.provider.ServerContextInvocationHandler.invoke(ServerContextInvocationHandler.java:35) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.remoting.provider.ProviderProcessor.handleRequest(ProviderProcessor.java:70) ~[hsf-feature-default-2.2.8.7-EDAS-1.jar!/:na]
at com.taobao.hsf.io.remoting.hsf.message.HSFServerHandler$1.run(HSFServerHandler.java:189) ~[hsf-io-remoting-hsf-2.2.8.7-EDAS-1.jar!/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_242]
This exception suggests that you raise a work order to Aliyun, this is not a seata problem! 这个异常建议你提工单给阿里云,这个不是seata的问题
PolarDB 1.x (DRDS) does not support cross-database transactions and does not allow the use of local transactions. This behavior will be validated in the Atom data source's database sharding execution strategy. If a method is annotated with GlobalTransactional, it will initiate a local transaction. The current solution is to upgrade PolarDB to version 2.0 to resolve this issue.
Ⅰ. Issue Description
Ⅱ. Describe what happened
If there is an exception, please attach the exception trace:
Ⅲ. Describe what you expected to happen
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Minimal yet complete reproducer code (or URL to code):
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
java -version
):uname -a
):