You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "erenboss (via GitHub)" <gi...@apache.org> on 2024/08/12 06:48:01 UTC
[I] Could not found global transaction xid [incubator-seata]
erenboss opened a new issue, #6744:
URL: https://github.com/apache/incubator-seata/issues/6744
使用 spring cloud 集群 + seata 集群 ,使用 @GlobalTransactional 注解,seata 版本1.4.2 ,报错如下
Error updating database. Cause: java.sql.SQLException: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = xxxxxx:8091:2010657011, may be has finished.] ]
排除接口超时问题
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2286400482
xid 不同就不会有影响,你应该根据tc的决议时间的日志来辅助判断你的代码是否有bug
It will not be affected if the xid is different. You should help determine whether there is a bug in your code according to the log of the resolution time of the tc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "erenboss (via GitHub)" <gi...@apache.org>.
erenboss commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2288151702
Caused by: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = xxxxxxxxxxxxxxx:8091:27574317618311697, may be has finished.] ]
at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:69)
at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96)
at io.seata.rm.datasource.ConnectionProxy.register(ConnectionProxy.java:272)
at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:250)
... 219 common frames omitted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "erenboss (via GitHub)" <gi...@apache.org>.
erenboss commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2285275584
> 通过xid去tc侧查看事务决议的时间是什么时候 Go to the tc side through xid to check when the transaction resolution is
@Before("transactionPointcut()")
public void before(JoinPoint joinPoint) throws TransactionException {
String treadName = Thread.currentThread().getName();
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
// 此处可用redis或者定时任务来获取一个key判断是否需要关闭分布式事务
// 模拟动态关闭分布式事务
String fullMethodName = signature.getDeclaringTypeName() + "." + method.getName();
String methodName = method.getName();
if (isNeedDistributedTransaction(methodName,fullMethodName)) {
log.debug("############# 分布式事务. xid:{};fullMethodName:{}", RootContext.getXID(), fullMethodName);
if (StringUtils.isBlank(RootContext.getXID())) {
GlobalTransaction tx = GlobalTransactionContext.getCurrentOrCreate();
log.debug("############# GlobalTransactionContext:{}", GlobalTransactionContext.getCurrentOrCreate());
tx.begin(180000, "GlobalTransaction:" + fullMethodName);
log.debug("############# 开启分布式事务. xid:{};fullMethodName:{}", RootContext.getXID(), fullMethodName);
CurrentUserInfo currentUserInfo = CurrentUserInfoHolder.get();
CurrentUserInfoHolder.get().setIsBeginSeataTransaction(true);
} else {
log.debug("############# 绑定分布式事务. xid:{};fullMethodName:{}", RootContext.getXID(), fullMethodName);
CurrentUserInfo currentUserInfo = CurrentUserInfoHolder.get();
Boolean isBeginSeataTransaction = CurrentUserInfoHolder.get().getIsBeginSeataTransaction();
RootContext.bind(RootContext.getXID());
}
} else {
log.debug("############# 不开启分布式事务. fullMethodName:{}", fullMethodName);
}
}
tx.begin(180000, "GlobalTransaction:" + fullMethodName);
我们是通过切面管理事务,在并发情况下,这里的name都是一样的,这里会有影响吗
GlobalTransaction.begin()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "erenboss (via GitHub)" <gi...@apache.org>.
erenboss commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2285154395
1.application.properties
seata.client.tm.default-global-transaction-timeout=300000
2.The execution time of this api is 7 seconds
> Check whether the maximum transaction execution time (1 minute by default) is exceeded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes closed issue #6744: Could not found global transaction xid
URL: https://github.com/apache/incubator-seata/issues/6744
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "slievrly (via GitHub)" <gi...@apache.org>.
slievrly commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2284463655
Check whether the maximum transaction execution time (1 minute by default) is exceeded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "erenboss (via GitHub)" <gi...@apache.org>.
erenboss commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2288126276
> tc的决议时间的日志
tc的决议时间的日志是看client端还是server端
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2285243592
通过xid去tc侧查看事务决议的时间是什么时候
Go to the tc side through xid to check when the transaction resolution is
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "erenboss (via GitHub)" <gi...@apache.org>.
erenboss commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2288120765
> xid 不同就不会有影响,你应该根据tc的决议时间的日志来辅助判断你的代码是否有bug It will not be affected if the xid is different. You should help determine whether there is a bug in your code according to the log of the resolution time of the tc.
[24-08-14.01:26:01.836 [XNIO-1 task-1 ] WARN XidResource - xid in change during RPC from null to xxxxxxxxxxxxx:8091:27574317618311697
[24-08-14.01:26:01.836 [XNIO-1 task-1 ] WARN XidResource - bind [xxxxxxxxx:8091:27574317618311697] back to RootContext
[24-08-14.01:26:03.855 [XNIO-1 task-1 ] WARN XidResource - xid in change during RPC from null to xxxxxxxxxxxxx:8091:27574317618311697
[24-08-14.01:26:03.855 [XNIO-1 task-1 ] WARN XidResource - bind [xxxxxxxxx:8091:27574317618311697] back to RootContext
[24-08-14.01:26:05.061 [XNIO-1 task-1 ] ERROR AbstractDMLBaseExecutor - execute executeAutoCommitTrue error:io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = xxxxxxxxxxxxx:8091:27574317618311697, may be has finished.] ]
java.sql.SQLException: io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = xxxxxxxxxxxxx:8091:27574317618311697, may be has finished.] ]
这个是应用服务的seata-client日志,为啥这里会from null ,我看正常的都会有,这个是分支的xid没有注册上嘛
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Could not found global transaction xid [incubator-seata]
Posted by "erenboss (via GitHub)" <gi...@apache.org>.
erenboss commented on issue #6744:
URL: https://github.com/apache/incubator-seata/issues/6744#issuecomment-2288156374
[2m00:07:28.936[0;39m [31mERROR[0;39m [2m---[0;39m [2m[verHandlerThread_1_28_500][0;39m [36mi.s.c.e.AbstractExceptionHandler [0;39m [2m:[0;39m Catch TransactionException while do RPC, request: xid=172.16.54.176:8091:9559919547032309,branchType=AT,resourceId=jdbc:mysql://xxxxxxxxxx:3306/cloud_shop_service,lockKey=shop_shop_product:354259
==>
io.seata.core.exception.GlobalTransactionException: Could not found global transaction xid = xxxxxxxxxxxx:8091:9559919547032309, may be has finished.
at io.seata.server.coordinator.AbstractCore.assertGlobalSessionNotNull(AbstractCore.java:126) ~[seata-server-1.4.2.jar:na]
at io.seata.server.coordinator.AbstractCore.branchRegister(AbstractCore.java:76) ~[seata-server-1.4.2.jar:na]
at io.seata.server.coordinator.DefaultCore.branchRegister(DefaultCore.java:100) ~[seata-server-1.4.2.jar:na]
at io.seata.server.coordinator.DefaultCoordinator.doBranchRegister(DefaultCoordinator.java:199) [seata-server-1.4.2.jar:na]
at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:184) ~[seata-server-1.4.2.jar:na]
at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:179) ~[seata-server-1.4.2.jar:na]
at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:124) ~[seata-core-1.4.2.jar:na]
at io.seata.server.AbstractTCInboundHandler.handle(AbstractTCInboundHandler.java:179) [seata-server-1.4.2.jar:na]
at io.seata.core.protocol.transaction.BranchRegisterRequest.handle(BranchRegisterRequest.java:136) [seata-core-1.4.2.jar:na]
at io.seata.server.coordinator.DefaultCoordinator.onRequest(DefaultCoordinator.java:473) [seata-server-1.4.2.jar:na]
at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.onRequestMessage(ServerOnRequestProcessor.java:116) [seata-core-1.4.2.jar:na]
at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.process(ServerOnRequestProcessor.java:77) [seata-core-1.4.2.jar:na]
at io.seata.core.rpc.netty.AbstractNettyRemoting.lambda$processMessage$2(AbstractNettyRemoting.java:279) [seata-core-1.4.2.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_291]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_291]
<==
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org