You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/06/23 06:28:58 UTC
[GitHub] [servicecomb-pack] ywdkfz opened a new issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
ywdkfz opened a new issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669
a服务调用b服务,b服务内部异常,希望通过b的本地事务回滚,不用补偿,怎么设置?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] ywdkfz commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
ywdkfz commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648671561
我是在业务代码上改的,没有单独写的简单demo,我看了下alpha-service的实现,会查出command eventId最大的状态是new的执行补偿的逻辑,全局事务出现异常的时候会把所有的分支事务注册的补偿的方法都去执行,并没有过滤抛出异常的那个子事务不补偿的相关处理
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] zhfeng commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648607422
能提供一个完整的例子吗?b服务的本地事务rollback后,omega应该发出TxAbortedEvent。alpha server收到这个消息后,应该是触发补偿操作,发送TxCompensatedEvent给需要做补偿的服务,按说b服务是不会收到这个消息的啊?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] zhfeng commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648678285
Contribution is welcome !
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] WillemJiang commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
WillemJiang commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648483694
使用spring transaction提供的 @transactional 来进行设置。
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] ywdkfz commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
ywdkfz commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648560273
b方法不跑出异常,a拿到b的结果是失败的要回滚a的本地事务跑出异常回滚a本地事务,结果还是会走b的补偿方法,但b方法实际上已经是失败的,不需要回滚的,还是会走了一次补偿
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] zhfeng commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648642461
OK, 那这里应该有问题的,b服务不应该再收到TxCompensatedEvent。您有简单的reproducer可以复现这个问题吗?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] ywdkfz commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
ywdkfz commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648526752
b方法的补偿方法不需要被调用,实际上调用了,怎么可以让b的补偿方法不调用呢
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] cmonkey commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
cmonkey commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648561176
> b方法不跑出异常,a拿到b的结果是失败的要回滚a的本地事务跑出异常回滚a本地事务,结果还是会走b的补偿方法,但b方法实际上已经是失败的,不需要回滚的,还是会走了一次补偿
明白你意思了,需要你在b 这个服务的补偿里面做一次校验, 看看传递的globalTxId 是否需要补偿
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] cmonkey commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
cmonkey commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648559018
> b方法的补偿方法不需要被调用,实际上调用了,怎么可以让b的补偿方法不调用呢
b方法不抛出异常就可以
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-pack] ywdkfz commented on issue #669: 怎么设置跑出异常的分支事务不补偿通通过本地事务回滚?
Posted by GitBox <gi...@apache.org>.
ywdkfz commented on issue #669:
URL: https://github.com/apache/servicecomb-pack/issues/669#issuecomment-648636146
b服务也是子事务之一也有补偿方法,b服务也收到了

----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org