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

optimize: check relation of before status and after status when updating global session #4629

Merged
merged 21 commits into from Jun 10, 2022

Conversation

Bughue
Copy link
Contributor

@Bughue Bughue commented May 23, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

redis模式下,检查全局事务状态的转变关系,以下四种方向不允许
rollback(进行中或结束)>> commit(进行中或结束)
commit(进行中或结束)>> rollback(进行中或结束)
timeout(进行中或结束)>> commit(进行中或结束)
commit(进行中或结束)>> timeout(进行中或结束)

Ⅱ. Does this pull request fix one issue?

#4372

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@lgtm-com
Copy link

lgtm-com bot commented May 24, 2022

This pull request introduces 1 alert when merging cb80631 into 09832bd - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

@codecov-commenter
Copy link

codecov-commenter commented May 25, 2022

Codecov Report

Merging #4629 (e2a7217) into develop (959bd90) will decrease coverage by 0.00%.
The diff coverage is 42.85%.

❗ Current head e2a7217 differs from pull request most recent head c233fb6. Consider uploading reports for the commit c233fb6 to get more accurate results

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4629      +/-   ##
=============================================
- Coverage      49.03%   49.03%   -0.01%     
- Complexity      4056     4067      +11     
=============================================
  Files            734      735       +1     
  Lines          25577    25594      +17     
  Branches        3156     3160       +4     
=============================================
+ Hits           12542    12549       +7     
- Misses         11699    11705       +6     
- Partials        1336     1340       +4     
Impacted Files Coverage Δ
...in/java/io/seata/server/session/GlobalSession.java 82.17% <0.00%> (ø)
...rage/redis/store/RedisTransactionStoreManager.java 66.66% <0.00%> (-0.97%) ⬇️
...o/seata/server/session/SessionStatusValidator.java 53.84% <53.84%> (ø)
...in/java/io/seata/server/session/SessionHelper.java 67.02% <100.00%> (+0.70%) ⬆️
...torage/file/store/FileTransactionStoreManager.java 56.77% <0.00%> (ø)

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

@funky-eyes funky-eyes added this to the 2.0.0 milestone May 25, 2022
@caohdgege
Copy link
Contributor

标题是optimize, 不是optimized

@Bughue Bughue changed the title optimized : check relation of before status and after status when updating global session optimize : check relation of before status and after status when updating global session Jun 10, 2022
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

@caohdgege caohdgege changed the title optimize : check relation of before status and after status when updating global session optimize: check relation of before status and after status when updating global session Jun 10, 2022
@caohdgege caohdgege merged commit 8f96afa into apache:develop Jun 10, 2022
* @param before the global session
* @param after the global session
*/
public static boolean validateUpdateStatus(GlobalStatus before, GlobalStatus after) {
Copy link
Member

Choose a reason for hiding this comment

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

A state flow control can be designed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A state flow control can be designed.

to prevent too many state updates at the same time?

liuqiufeng pushed a commit to liuqiufeng/seata that referenced this pull request Jun 11, 2022
@slievrly slievrly modified the milestones: 2.0.0, 1.5.2 Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants