apache / servicecomb-pack

Apache ServiceComb Pack is an eventually data consistency solution for micro-service applications. ServiceComb Pack currently provides TCC and Saga distributed transaction co-ordination solutions by using Alpha as a transaction coordinator and Omega as an transaction agent .
https://servicecomb.apache.org/
Apache License 2.0
1.93k stars 435 forks source link

TCC模式args记录在ParametersContext里,会不会无法confirm/cancel #654

Closed mtnan closed 4 years ago

mtnan commented 4 years ago

我看TCC模式下,Omega的Try方法入参是记录在本地的

// Send the participate message back
tccMessageSender.participationEnd(new ParticipationEndedEvent(context.globalTxId(), context.localTxId(), localTxId, confirmMethod, cancelMethod, TransactionStatus.Succeed));
// Just store the parameters into the context
parametersContext.putParameters(context.localTxId(), joinPoint.getArgs());

这样如果alpha的confirm/cancel指令下发到Omega之前,Omega宕机了,不会导致没法Omega无法补偿吗?

WillemJiang commented 4 years ago

目前TCC的参数没有传递到Alpha, 的确有你说的那个问题。

mtnan commented 4 years ago

目前TCC的参数没有传递到Alpha, 的确有你说的那个问题。

我看Saga模式是会上报到alpha的,当初这样设计是为了性能还是其他什么考虑?

WillemJiang commented 4 years ago

当时实现TCC的时候打算做一些性能优化的事情,在实现的时候采用的参数本地存储做了一些试验。@mtnan 你这边有什么具体的述求吗?

WillemJiang commented 4 years ago

这个问题已经有结论了,所有先关闭, 有问题我们在继续讨论。