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: modify the deletion mechanism of the tcc_fence_log table #3994

Merged
merged 21 commits into from
Sep 28, 2021

Conversation

dmego
Copy link
Contributor

@dmego dmego commented Aug 31, 2021

Ⅰ. Describe what this PR did

目前 TCCFenceConfig 配置初始化和删除 tcc_fence_log 表的定时任务由配置文件中的一个开关控制,现优化为:如果用户开启 TCC 防悬挂功能,则自动开启初始化配置和开启删除的定时任务

Ⅱ. Does this pull request fix one issue?

fixes #3807

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

主要实现逻辑是在 GlobalTransactionScanner#wrapIfNecessary() 调用的 TCCBeanParserUtils#isTccAutoProxy() 方法中。在判断 isTccProxyTargetBean()时,判断是否开启了 TwoPhaseBusinessAction.useTCCFence,如果是则初始化 TCCFenceConfig 配置类,开启自动清理的定时任务

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2021

Codecov Report

Merging #3994 (1aaf6ea) into develop (8456fb6) will increase coverage by 0.00%.
The diff coverage is 6.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3994   +/-   ##
==========================================
  Coverage      49.91%   49.91%           
- Complexity      3767     3770    +3     
==========================================
  Files            698      697    -1     
  Lines          23509    23513    +4     
  Branches        2910     2908    -2     
==========================================
+ Hits           11735    11737    +2     
  Misses         10593    10593           
- Partials        1181     1183    +2     
Impacted Files Coverage Δ
...ava/io/seata/core/constants/ConfigurationKeys.java 0.00% <ø> (ø)
...configure/SeataClientEnvironmentPostProcessor.java 0.00% <0.00%> (ø)
.../autoconfigure/SeataTCCFenceAutoConfiguration.java 0.00% <ø> (ø)
...ta/spring/boot/autoconfigure/StarterConstants.java 100.00% <ø> (ø)
...in/java/io/seata/rm/tcc/config/TCCFenceConfig.java 0.00% <0.00%> (ø)
...ava/io/seata/rm/tcc/constant/TCCFenceConstant.java 0.00% <ø> (ø)
...eata/rm/tcc/store/db/TCCFenceStoreDataBaseDAO.java 0.00% <0.00%> (ø)
.../java/io/seata/spring/util/TCCBeanParserUtils.java 32.25% <6.66%> (-8.17%) ⬇️
...ta/spring/annotation/GlobalTransactionScanner.java 29.08% <100.00%> (+0.36%) ⬆️

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.

使用 java.time.Duration/java.time.Period 代替自己解析会不会更好一点?

changes/1.5.0.md Outdated Show resolved Hide resolved
@dmego
Copy link
Contributor Author

dmego commented Sep 18, 2021

@caohdgegeperiod解析换成了 java.time.Duration类型。因为转换类型问题,定义period最大值是Duration.ofSeconds(Integer.MAX_VALUE), 大约是68年。

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

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

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 type: optimize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optimize:modify the delete mechanism of the tcc_fence_log table
6 participants