Git Product home page Git Product logo

Comments (17)

chenhh23 avatar chenhh23 commented on September 17, 2024

你好 解决了吗?

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

有自己添加重试机制吗?还是怎么处理的?

from tx-lcn.

coolbeevip avatar coolbeevip commented on September 17, 2024

TM 通知 B 或者 C 失败后吞没了异常,我改成了抛出异常给 A。让业务侧感知到这个问题。此时导致事务不一致是不可避免的。这时就需要人工干预了

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

你直接吞吐异常的话 也是可以人工干预的啊

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

感觉是不是可以在tc端单独起个线程,如果有通知失败的情况 直接把之前的提交给回滚

from tx-lcn.

coolbeevip avatar coolbeevip commented on September 17, 2024

感觉是不是可以在tc端单独起个线程,如果有通知失败的情况 直接把之前的提交给回滚

都提交了,怎么回滚?

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

定义一个回滚的接口 具体代码根据业务了

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

人工干预也是一样的吧? 要么提交要么回滚

from tx-lcn.

coolbeevip avatar coolbeevip commented on September 17, 2024

我感觉这里的关键问题当出现提交或者回滚失败的时候要让 A 服务知道。目前主干版本 A 是不知道通知失败的。因为 TM 吞没了异常。由于这不是柔性事务,我觉得即使重试也不适合太长时间和次数,因为这会导致锁表的时间过长。

总之,我觉得让事务发起方 A 知道失败就可以了,这样业务系统使用者就能感知到出现了数据不一致的异常。然后人为去处理就行了

from tx-lcn.

coolbeevip avatar coolbeevip commented on September 17, 2024

定义一个回滚的接口 具体代码根据业务了

如果回滚还需要接口,那么还不如直接用基于 SAGA 模式的柔性事务实现

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

我感觉这里的关键问题当出现提交或者回滚失败的时候要让 A 服务知道。目前主干版本 A 是不知道通知失败的。因为 TM 吞没了异常。由于这不是柔性事务,我觉得即使重试也不适合太长时间和次数,因为这会导致锁表的时间过长。

总之,我觉得让事务发起方 A 知道失败就可以了,这样业务系统使用者就能感知到出现了数据不一致的异常。然后人为去处理就行了
A知道了也是人工处理 但看那个aspectLog也是一样的人工处理啊

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

定义一个回滚的接口 具体代码根据业务了

如果回滚还需要接口,那么还不如直接用基于 SAGA 模式的柔性事务实现

这个只是针对失败场景的处理啊 正常情况或者是基本大部分情况还是走的原来的流程啊

from tx-lcn.

Jasonfory avatar Jasonfory commented on September 17, 2024

按照流程图
image
只有“5.响应通知事务组”异常才会有数据不一致的问题,因为B,C异常,事务协调器(T)是能感知的,并且会告知A。

from tx-lcn.

chenhh23 avatar chenhh23 commented on September 17, 2024

按照流程图
image
只有“5.响应通知事务组”异常才会有数据不一致的问题,因为B,C异常,事务协调器(T)是能感知的,并且会告知A。

怎么告知?

from tx-lcn.

coolbeevip avatar coolbeevip commented on September 17, 2024

按照流程图
image
只有“5.响应通知事务组”异常才会有数据不一致的问题,因为B,C异常,事务协调器(T)是能感知的,并且会告知A。

遗憾的是,实际的实现与这个图有一些差异,当 commit[1] 或 rollback[2] 后时如果出现 RPC 通信异常,那么此处并不会抛出异常

[1]

[2]

from tx-lcn.

Jasonfory avatar Jasonfory commented on September 17, 2024

看这个#8 发起方的TC会通知TM补偿事务

from tx-lcn.

coolbeevip avatar coolbeevip commented on September 17, 2024

看这个#8 发起方的TC会通知TM补偿事务

由于RPC 通讯异常,补偿失败时,全局事务的业务发起方无法收到异常,因为异常被 TM 吞没了

from tx-lcn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.