Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Bughue
Copy link
Contributor

@Bughue Bughue commented Aug 11, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

重新整理SessionHolder里面的几个sessionManager,统一把对globalsession的增删查改都改为使用root manager。
现在还没正式改好代码,我把需要改的地方全部todo标注出来,后面改的时候每改一个就删一个todo注释。以下是梳理情况:

  1. 查询(把有非root的地方改成root.findxx ,真正要改的地方只有3个,已经用红色圈出来)
    allsessions本来在不同的manager有自带不同的查询条件,但现在看起来已经被改造过了
    image
    image
    image
    image

  2. 删除(把有非root的地方改成root.removexx ,真正要改的地方只有4个,已经用红色圈出来)
    image

  3. 更新(实际上只有changeStatus调用,但用到这个的地方很多,经过讨论决定把listener逻辑从manager摘出去)
    image

  4. 新增(分两种情况,1是真正的新增,改成root.addxx ,2其实是更新,改成root.updatexx,具体属于1还是2可以看代码todo标识)
    image

Ⅱ. Does this pull request fix one issue?

部分解决 #4857

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@Bughue Bughue changed the title [WIP] optimize : reorganize the usage of task session manager [WIP] optimize : reorganize the usage of task session manager(add/remove/find) Aug 22, 2022
@Bughue Bughue changed the title [WIP] optimize : reorganize the usage of task session manager(add/remove/find) optimize : reorganize the usage of task session manager(add/remove/find) Aug 22, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2022

Codecov Report

Merging #4858 (55d5c03) into 2.x (4527a41) will decrease coverage by 0.06%.
The diff coverage is 76.47%.

❗ Current head 55d5c03 differs from pull request most recent head 0cb40a4. Consider uploading reports for the commit 0cb40a4 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #4858      +/-   ##
============================================
- Coverage     48.78%   48.73%   -0.06%     
+ Complexity     4164     4157       -7     
============================================
  Files           743      743              
  Lines         26588    26577      -11     
  Branches       3320     3320              
============================================
- Hits          12970    12951      -19     
- Misses        12220    12229       +9     
+ Partials       1398     1397       -1     
Impacted Files Coverage Δ
...ava/io/seata/server/transaction/saga/SagaCore.java 2.75% <0.00%> (ø)
...in/java/io/seata/server/session/GlobalSession.java 79.00% <80.00%> (-0.39%) ⬇️
...o/seata/server/coordinator/DefaultCoordinator.java 46.21% <83.33%> (-0.40%) ⬇️
...o/seata/server/session/AbstractSessionManager.java 61.76% <100.00%> (-2.42%) ⬇️
...in/java/io/seata/server/session/SessionHolder.java 61.41% <100.00%> (+0.98%) ⬆️
.../java/io/seata/server/coordinator/DefaultCore.java 48.23% <0.00%> (-5.89%) ⬇️
...in/java/io/seata/server/session/BranchSession.java 78.57% <0.00%> (-0.72%) ⬇️
...erver/storage/file/session/FileSessionManager.java 47.77% <0.00%> (-0.64%) ⬇️
... and 2 more

@Bughue Bughue changed the title optimize : reorganize the usage of task session manager(add/remove/find) optimize : reorganize the usage of task session manager(add/remove/find/部分update) Aug 23, 2022
@Bughue Bughue changed the title optimize : reorganize the usage of task session manager(add/remove/find/部分update) optimize : reorganize the usage of task session manager(add/remove/find/update) Sep 7, 2022
@slievrly slievrly added the TC/store store mode label Sep 7, 2022
@funky-eyes
Copy link
Contributor

sessionMnager改造终态分4步
1.将分散的不同功能的sessionManager合并为rootsessionmanager简化学习和使用成本
#4858
2.将listener与sessionmanager分离,各司其职,将原先由onxxxx的listener方法改为直接调用sessionmanager对应方法
#4881
3.将globalsession中的业务逻辑转移至sessionmanager中,globalsession为一个do角色
4.将sessionmanager中的sessionmanager做进一步的优化,filesessionmanager进行对不同status的globalsession分门别类处理,加快file的增删改查效率

@CLAassistant
Copy link

CLAassistant commented Dec 12, 2022

CLA assistant check
All committers have signed the CLA.

@funky-eyes funky-eyes added this to the 2.0.0 milestone Jan 31, 2023
funky-eyes
funky-eyes previously approved these changes Jan 31, 2023
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 changed the base branch from develop to 2.x January 31, 2023 07:11
@funky-eyes funky-eyes dismissed their stale review January 31, 2023 07:11

The base branch was changed.

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

@Bughue
Copy link
Contributor Author

Bughue commented May 24, 2023

pr做的不够干净,关联一下后续 #5604

YvCeung pushed a commit to YvCeung/incubator-seata that referenced this pull request Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants