Skip to content
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 commit and rollback method support @BusinessActionContextParameter("opId") long opId #3823

Merged
merged 30 commits into from
Jul 12, 2021

Conversation

yujianfei1986
Copy link
Contributor

@yujianfei1986 yujianfei1986 commented Jun 11, 2021

Ⅰ. Describe what this PR did

tcc模式,commit和rollback方法,支持 @BusinessActionContextParameter("opId") long opId方式

Ⅱ. Does this pull request fix one issue?

Some improvments abount TCC are in planning or in progress?
fixes #2421

Ⅲ. Why don't you add test cases (unit test/integration test)?

不需要

Ⅳ. Describe how to verify it

新feature

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2021

Codecov Report

Merging #3823 (9582afa) into develop (4038168) will increase coverage by 0.04%.
The diff coverage is 22.64%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3823      +/-   ##
=============================================
+ Coverage      40.67%   40.72%   +0.04%     
- Complexity      2991     3007      +16     
=============================================
  Files            676      676              
  Lines          22614    22660      +46     
  Branches        2808     2813       +5     
=============================================
+ Hits            9199     9228      +29     
- Misses         12564    12581      +17     
  Partials         851      851              
Impacted Files Coverage Δ
...src/main/java/io/seata/rm/tcc/TCCFenceHandler.java 0.00% <0.00%> (ø)
tcc/src/main/java/io/seata/rm/tcc/TCCResource.java 0.00% <0.00%> (ø)
.../main/java/io/seata/rm/tcc/TCCResourceManager.java 0.00% <0.00%> (ø)
.../rm/tcc/remoting/parser/DefaultRemotingParser.java 23.80% <60.00%> (+23.80%) ⬆️
...ta/rm/tcc/remoting/parser/DubboRemotingParser.java 3.84% <0.00%> (+3.84%) ⬆️
.../rm/tcc/remoting/parser/SofaRpcRemotingParser.java 4.54% <0.00%> (+4.54%) ⬆️
...n/src/main/java/io/seata/common/util/IdWorker.java 83.33% <0.00%> (+6.25%) ⬆️
...eata/rm/tcc/remoting/parser/HSFRemotingParser.java 7.69% <0.00%> (+7.69%) ⬆️

@caohdgege caohdgege added mode: TCC TCC transaction mode module/tcc tcc module labels Jun 12, 2021
@wangliang181230 wangliang181230 changed the title feature: tcc-mode commit and rollback method support "@BusinessActionContextParameter"opId") long opId" feature: tcc-mode commit and rollback method support @BusinessActionContextParameter("opId") long opId Jun 12, 2021
@wangliang181230
Copy link
Contributor

想了下,Commit和Rollback方法的入参是否可以不同?如果肯定相同的话,请忽略我的这个疑问。

@yujianfei1986
Copy link
Contributor Author

想了下,Commit和Rollback方法的入参是否可以不同?如果肯定相同的话,请忽略我的这个疑问。

暂时是不是先考虑二阶段方法参数列表保持一致。如果以后有场景或是明确需求,再考虑??如果二阶段方法参数还不一样,那TwoPhaseBusinessAction注解里加的定义参数类型的数组,意义好像也不大了?或是还需要定义更多的数组,commit方法参数的数组,rollback方法参数的数组,使用起来好像就更麻烦了

@wangliang181230 wangliang181230 added this to the 1.5.0 milestone Jun 20, 2021
Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  1. 一处代码重构一下。
  2. 1.5.0.md补充一下PR信息。

其他我没问题了。

Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

wangliang181230 added a commit to wangliang181230/seata that referenced this pull request Jun 22, 2021
wangliang181230 added a commit to wangliang181230/seata that referenced this pull request Jun 23, 2021
Copy link
Contributor

@tanzzj tanzzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -192,11 +195,15 @@ private static boolean insertTCCFenceLog(Connection conn, String xid, Long branc
* @param status the tcc fence status
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param args

@@ -51,13 +53,14 @@ boolean prepare(BusinessActionContext actionContext,
* @param actionContext the action context
* @return the boolean
*/
boolean commit(BusinessActionContext actionContext);
boolean commit(BusinessActionContext actionContext,
@BusinessActionContextParameter("tccParam") TccParam param, @Param("a") Integer a);

/**
* Rollback boolean.
*
* @param actionContext the action context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param param

@caohdgege
Copy link
Contributor

麻烦处理一下代码冲突

# Conflicts:
#	changes/1.5.0.md
#	changes/en-us/1.5.0.md
#	tcc/src/main/java/io/seata/rm/tcc/TCCFenceHandler.java
#	tcc/src/main/java/io/seata/rm/tcc/TCCResourceManager.java
@yujianfei1986
Copy link
Contributor Author

麻烦处理一下代码冲突

done

Copy link
Contributor

@caohdgege caohdgege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for @tanzzj

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangliang181230 wangliang181230 merged commit 119f6eb into apache:develop Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mode: TCC TCC transaction mode module/tcc tcc module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some improvments abount TCC are in planning or in progress?
6 participants