How to smooth the upgrade after transferring to an apache organization #6059
Replies: 9 comments 3 replies
-
https://github.com/apache/incubator-seata/wiki/Design-of-io.seata-Upgrade-Compatibility-Solution |
Beta Was this translation helpful? Give feedback.
-
API 梳理TODO
API全局事务生命周期tm.api 包 数据源代理SpringEnableAutoDataSourceProxy.java TCCseata-tcc rm.tcc.api BusinessActionContextParameter.java Saga核心入口实现 ProcessCtrlStateMachineEngine.java DefaultStateMachineConfig.java 组件HierarchicalProcessContext.java 实现 领域模型domain 包下所有内容 验证验证规则 SPI 扩展拦截器 TransactionPropagationInterceptor.java https://github.com/apache/incubator-seata/tree/2.x/integration/grpc |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
io.seata:seata-server迁移至org.apache.seata:seata-server待讨论问题: 2.保留所有老类,增加集群间的版本协商能力,通过jraft扩展的出集群同步能力,在选主前记录每个节点的版本,使用最低版本的协议进行兼容,直到所有节点都是最新版才启用新包下的同步类。 (复杂度高,但100%兼容) 3.仅保留协议类,因为新版向下兼容,升级的过程中会重选举,新节点不太可能成为leader,只要新节点超过半数,老节点序列化异常并不会影响集群稳定性,举个例子假设节点 1,2,3 3为leader,1和2滚动升级,3继续为leader,1,2节点兼容节点3的同步消息,集群没有任何影响,最后再升级节点3,集群完成升级。如果节点2为leader的情况下升级,那么升级1,2后,触发重选举,可能1,2之间产生一个新leader,新leader进行同步时,节点3由于序列化失败,状态机不会继续往下执行,但是同步log继续会落到磁盘中,当节点3升级后,他便能解析之前的raft log,能迅速恢复的数据一致的状态。(高度兼容,官网侧升级方案即可) The issue being discussed is the migration from io.seata:seata-server to org.apache.seata:seata-server in a Raft cluster synchronization scenario. The problem arises due to the use of different packages and changes in class paths. In the new version, the classes are located in a different package, causing deserialization failures in the old version when it acts as the leader and initiates synchronization tasks. There are several proposed solutions: 1.Preserve all the old classes and use them directly for synchronization. This ensures complete compatibility but results in the classes remaining in the io.seata package. This approach is simple but not elegant. 2.Preserve all the old classes and introduce version negotiation capabilities between cluster nodes. Using extensions provided by jraft, record the version of each node before leader election and use the lowest version protocol for compatibility until all nodes are upgraded to the latest version. This solution is more complex but guarantees 100% compatibility. 3.Keep only the protocol classes. Since the new version is backward compatible, during the upgrade process, there will be a re-election, and it is unlikely that a new node will become the leader. As long as more than half of the nodes are upgraded, the serialization failures in the old nodes won't affect the stability of the cluster. This solution provides a high level of compatibility and can be considered as an official upgrade plan. The discussion aims to determine the best approach for a smooth migration from io.seata:seata-server to org.apache.seata:seata-server in a Raft cluster mode. |
Beta Was this translation helpful? Give feedback.
-
Involves modules that need to be compatible with the |
Beta Was this translation helpful? Give feedback.
-
我想我遗漏了一点,我们的spi是否要向下兼容,这是一个问题。让我举个例子以便于理解: I think I'm missing the point that it's a matter of whether or not our spi is going to be backward compatible. Let me give you an example to make it easier to understand: Suppose the user is using |
Beta Was this translation helpful? Give feedback.
-
The compatibility processing of the following modules has been completed: |
Beta Was this translation helpful? Give feedback.
-
At present, the modules I have completed include: |
Beta Was this translation helpful? Give feedback.
-
迁移到apache organization后,原io.seata包下的代码都要迁移至org.apache.seata中,这种改动很可能会造成用户侧升级时需要改造代码,故我们需要讨论一个方法尽量减少用户的迁移成本。
首先2.x分支上我们已经对tcc以及事务代理这块的spring依赖做了去除,目前遗留的可能是saga模块中对spring的强依赖是一个问题。
我们可以参考dubbo社区的经验,将api和注解保留io.seata这个包,在org.apache.seata中新增相关的api和注解。
After migrating to the Apache organization, the code under the original io.seata package needs to be transferred to org.apache.seata. This kind of change is likely to require code modifications when users upgrade, so we need to discuss a method to minimize the migration cost for users.
Firstly, on the 2.x branch, we have already removed the spring dependencies for TCC and transaction proxy. The remaining issue may be the strong dependency on Spring in the saga module.
We can refer to the experience of the Dubbo community, where the API and annotations are retained in the io.seata package, and 1. relevant API and annotations are added in the org.apache.seata package.
Beta Was this translation helpful? Give feedback.
All reactions