incubator-seata
incubator-seata copied to clipboard
:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
…guration class may do not work - [ ] I have registered the PR [changes](https://github.com/seata/seata/tree/develop/changes). ### Ⅰ. Describe what this PR did bugfix: the @ConditionalOnBean annotation on SeataDataSourceAutoConfiguration class may...
- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate. ### Ⅰ. Issue Description 通过阅读这篇文章 https://seata.io/zh-cn/blog/seata-at-lock.html, 文中提到 如何防止脏读, 查询 A 时加...
- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate. ### Ⅰ. Issue Description seata-server侧定义的metrics常量,在发布metrics记录时,会存在tag覆盖的情况:  ### Ⅱ. Describe what happened...
- [ ] I have registered the PR [changes](https://github.com/seata/seata/tree/develop/changes). ### Ⅰ. Describe what this PR did 修复seata-server侧在发布metrics时,其tag覆盖的问题; 期望:每个拥有不同tags的metric,都能独立记录其度量,不会产生tag覆盖问题。 ### Ⅱ. Does this pull request fix one issue? fixes #4859 ###...
- [ ] I have registered the PR [changes](https://github.com/seata/seata/tree/develop/changes). ### Ⅰ. Describe what this PR did 重新整理SessionHolder里面的几个sessionManager,统一把对globalsession的增删查改都改为使用root manager。 现在还没正式改好代码,我把需要改的地方全部todo标注出来,后面改的时候每改一个就删一个todo注释。以下是梳理情况: 1. 查询(把有非root的地方改成root.findxx ,真正要改的地方只有3个,已经用红色圈出来) allsessions本来在不同的manager有自带不同的查询条件,但现在看起来已经被改造过了     2. 删除(把有非root的地方改成root.removexx ,真正要改的地方只有4个,已经用红色圈出来)...
seata版本1.5.1,注册到nacos两个节点,客户端采用saga模式,正常情况下,一个事务请求会被分配到一个seata节点管理,如图: 业务流程正常结束,事务被committed。但测试的时候经常发现,当一个事务请求被分配到一个节点后,这个事务的部分日志会出现在另一个节点,那么此时,就算业务流程已经执行完毕,也不会打印committed那条日志,如图: 接收请求的seata节点日志: 另一个节点: 之后,seata服务节点会一直等待超时,这个超时时间是由这个参数:transOperationTimeout控制的,默认值1800000ms。 到了超时时间,若客户端与服务端已经断开连接,服务端就会一直报错:Failed Rollback,1s一次。 若连接未断开,则会打印如下日志: 对客户端进行整体回滚,但这之前业务其实已经执行成功了!
## Why you need it? Is your feature request related to a problem? Please describe in details 目前SessionHolder里面带有4个session manager(root/async_commit/retry_commit/retry_rollback),这4个manager在很多场景下都等价,所以root以外的manager大多被滥用,造成代码难读和维护困难,在进行新功能开发时也无法收敛到同一处,例如: 以下两个写法是等价的(都是移除全局事务) ``` SessionHolder.getRetryCommittingSessionManager().removeGlobalSession(committingSession); SessionHolder.getRootSessionManager().removeGlobalSession(committingSession); ``` 但以下两个写法是不一定等价的(在db/redis模式下用root是真正的新增,而用其他的则是更新,这和方法名称表达也不一致。) ``` SessionHolder.getRetryCommittingSessionManager().addGlobalSession(session); SessionHolder.getRootSessionManager().addGlobalSession(session); ``` 另一个问题是在globalsession里面addSessionLifecycleListener,可能会让globalsession持有多个manager,在某些操作(比如changestatus的时候,就会出现调用多次manager的情况,如果他们行为一致,那就是多余操作,如果他们行为不一致,那后果可能更严重)...
### Ⅰ. Describe what this PR did 更新globalstatus的时候采用线程安全的方式,阻止预期状态不匹配的操作继续执行。 目前的思路是:rollback和commit都用乐观锁方式去更新globalsession的status,更新成功的会往下执行。没有更新成功的会遇到异常而中断。 传参expected status方式使用threadlocal 以下两个pr优化了之后,这个pr可以简化 https://github.com/seata/seata/pull/4858 https://github.com/seata/seata/pull/4881 ### Ⅱ. Does this pull request fix one issue? fixes https://github.com/seata/seata/issues/4372 ### Ⅲ. Why don't you...
- [ ] I have registered the PR [changes](https://github.com/seata/seata/tree/develop/changes). ### Ⅰ. Describe what this PR did redis模式里的updateGlobalTransactionDOreturn或者throw之前的 unwatch是没有必要的,因为在close的时候都会重置状态。 这个pr做了两件事 1. 去掉没有必要的unwatch(如果觉得有风险可以先改成finally里面统一unwatch) 2. 优化代码格式 ### Ⅱ. Does this pull request fix...
## Why you need it? Is your feature request related to a problem? Please describe in details redis模式里的updateGlobalTransactionDO在处理redis事务时使用了watch,但是使用unwatch的写法不统一,有些在抛出异常或者return之前执行了unwatch,有些则没有。需要搞清楚unwatch是不是必须的,然后保持写法一致 ## How it could be? A clear and concise description of what...