-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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: TCC mode support idempotent and anti hanging #3545
Conversation
粗略看了下没有代理数据源,无法保证本地事务和状态控制表的原子性和排他性,无法保证幂等和防悬挂,我们内部在做的也是基于tcc状态表,但是需要让业务的1阶段和2阶段的本地事务和seata做tcc幂等和防悬挂的sql处于一个本地事务中 |
connection没有使用与业务同一个connection,如何保证本地流程控制表提交后,本地事务也提交,或本地流程控制表提交后,本地事务异常,导致二阶段重试时,发现流程控制表已经更新认为事务已经完成的问题? |
Codecov Report
@@ Coverage Diff @@
## develop #3545 +/- ##
=============================================
- Coverage 52.12% 51.39% -0.73%
- Complexity 3502 3505 +3
=============================================
Files 638 647 +9
Lines 21108 21419 +311
Branches 2618 2648 +30
=============================================
+ Hits 11003 11009 +6
- Misses 9016 9323 +307
+ Partials 1089 1087 -2
|
Codecov Report
@@ Coverage Diff @@
## develop #3545 +/- ##
=============================================
- Coverage 41.32% 40.82% -0.50%
Complexity 2947 2947
=============================================
Files 654 663 +9
Lines 21982 22261 +279
Branches 2726 2757 +31
=============================================
+ Hits 9084 9089 +5
- Misses 12052 12326 +274
Partials 846 846
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
有个疑问: |
哦,有 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
tcc support idempotent、anti-hanging and empty-roll-back
Ⅱ. Does this pull request fix one issue?
fixes #3490
fixes #2421
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
实现思路:
新增了一张tcc的状态控制表;
在执行一阶段方法前会在该控制表中新增一条记录,状态为初始化;
在执行二阶段方法时会根据该控制表中状态来决定是否继续执行,并对防悬挂和空回滚的异常请求进行处理;
一二阶段可以通过该表中是否存在相应记录来进行幂等控制;