-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: when use tcc fence, add a config to enable empty rollback #4532
base: develop
Are you sure you want to change the base?
Feature: when use tcc fence, add a config to enable empty rollback #4532
Conversation
一阶段预计有n个参与者RM,但是第m个参与者prepare失败,产生全局rollback。这个时候的rm分3种情况 这个pr处理的是3对吗?看pr里面好像区分不了1和3,所以是业务自行判断? |
是针对第3种情况,至于第1种情况中没有prepare的RM,因为没有注册分支所以不会参与二阶段,不用区分也没问题。 |
理解。不过这种prepare失败的rollback和常规tcc的rollback(prepare成功)的含义不太一样,这种更像是本地事务的一致性,做在这里会不会有点奇怪 |
没想到其他合适的处理方式,现在问题就是本地事务已经无法解决了,才需要利用分布式事务解决。 其实这个fencelog说是防悬挂,但实际上是一起做了防悬挂和防空回滚的,这里只不过是提供一种将空回滚拿出来单独控制的能力。 而且我理解在分布式事务中,参与了事务一阶段的分支都应该有权利选择是否参与事务的二阶段。 当然也可以通过RM的钩子来监听全局事务状态进行一些补偿操作,但是如果RM正常收到了二阶段回滚,在钩子里还会再处理一次。 钩子应该只处理一些和全局事务一致性弱相关的事宜,比起放钩子里感觉这个方案更合适一些 |
|
Codecov Report
@@ Coverage Diff @@
## develop #4532 +/- ##
=============================================
- Coverage 49.35% 49.34% -0.02%
Complexity 4073 4073
=============================================
Files 731 731
Lines 25465 25471 +6
Branches 3156 3157 +1
=============================================
Hits 12569 12569
- Misses 11559 11565 +6
Partials 1337 1337
|
Ⅰ. Describe what this PR did
在TCC注解中添加一个配置去开关空回滚的拦截能力, 具体场景可在 #4530 中了解。该PR希望大佬们可以一起交流讨论,提供一些建议
Ⅱ. Does this pull request fix one issue?
fixes #4530
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews