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/03/06 09:15:08 UTC

[GitHub] [servicecomb-pack] dingsongjie opened a new issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问

dingsongjie opened a new issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问
URL: https://github.com/apache/servicecomb-pack/issues/636
 
 
           有A,B,C 三个服务。 服务B中事务成功执行 ,然而 服务C中事务成功执行,却在omega 发送end指令前重启了,A服务会接收到C服务出错的信息,会进行补偿操作 。
          此时alpha 知道 B中事务已经完成,C中事务只是开始,应该只会对B中之前执行的事务进行补偿,然而此时C服务的事务其实已经被执行了。
          我所说的这种情况会不会发生,如果不会发生是怎么避免的?

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] xiaozhitaba commented on issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问

Posted by GitBox <gi...@apache.org>.
xiaozhitaba commented on issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问
URL: https://github.com/apache/servicecomb-pack/issues/636#issuecomment-595708399
 
 
   你的是哪个设计文档 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] WillemJiang commented on issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问

Posted by GitBox <gi...@apache.org>.
WillemJiang commented on issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问
URL: https://github.com/apache/servicecomb-pack/issues/636#issuecomment-595809706
 
 
   为了简化操作, C服务在执行的过程中需要保证其原子性, 这里我们可以通过Spring 提供的Transactional注解来保证。 当Omega发现Transaction end指令给Alpha的的时候Alpha重启, Omega的这个指令是会发送失败的, C服务的执行就会失败, 如果C服务有相关的数据库提交的, 那C服务是需要进行相关的回滚操作的。 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] coolbeevip commented on issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问
URL: https://github.com/apache/servicecomb-pack/issues/636#issuecomment-596079062
 
 
   正如 @WillemJiang 所说每个服务的方法中需要保证自身的原子事务(例如C服务的方法中使用数据库事务)
   
   如果你的C方法中无法保证原子事务(例如:C方法就是负责发送一个邮件),那么就需要额外的方式处理,例如在A方法中检测到异常后判断如果C方法出现异常则再补发有一个邮件 :(,此时可能无法判断C服务的异常是在邮件发送成功前还是成功后(也许你需要更多的步骤解决这个问题)
   
   或许我们可以通过一种机制,让A服务捕获到异常时能够知道整个事务链的状态,从而做一些额外的处理 cc @WillemJiang 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] dingsongjie closed issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问

Posted by GitBox <gi...@apache.org>.
dingsongjie closed issue #636: 我看了一下设计文档,对 sagas 流程有一点疑问
URL: https://github.com/apache/servicecomb-pack/issues/636
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services