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: strength console to operate transaction #5856

Merged

Conversation

MeteorShower-l
Copy link

@MeteorShower-l MeteorShower-l commented Sep 17, 2023

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

  1. 控制台操作全局锁:删除全局锁操作
  2. 控制台操作分支事务:
  • 停止分支事务重试 / 继续分支事务重试
  • 物理删除分支事务:删除分支事务纪录
    • AT:删除全局锁和RM端的undo log
    • TCC:删除tcc fence纪录
    • XA:回滚分支操作
  1. 控制台操作全局事务
  • 停止全局事务重试 / 继续全局事务重试
  • 改变全局事务状态
  • 发送单次提交或回滚
  • 删除全局事务:即删除所有分支事务以及全局事务纪录

Ⅱ. Does this pull request fix one issue?

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

UT:

  • BranchDeleteRequestConvertorTest .java:PASS
  • BranchDeleteResponseConvertorTest.java:PASS
  • BranchDeleteRequestCodecTest.java:PASS
  • BranchDeleteResponseCodecTest.java:PASS
  • FileSessionManagerTest.java:stopGlobalSessionTest/changeGlobalSessionTest/startGlobalSessionTest/stopBranchRetryTest/restartBranchFailRetryTest :PASS

详设:
控制台增强详细设计.pdf
测试用例:
控制台事务实现.xlsx

Ⅳ. Describe how to verify it

  1. 在console/src/main/resources/static下使用npm start开启前端代码
  2. 开启seata server服务
  3. 启动客户端,制造重试提交或重试回滚的数据,客户端例子:RM端可以有三个服务,分别为TCC,AT,XA模式,先执行TCC分支,在执行AT/XA。回滚用例:在@GlobalTransaction中,抛出异常,制造回滚,让TCC分支回滚时抛异常出错。提交用例:在@GlobalTransaction中,不抛出异常,正常提交,TCC分支提交抛异常出错。AT与XA保证没有问题,进行验证
  4. 验证全局锁操作:RM选择AT,制造一些回滚重试的场景进行删除全局锁操作
  5. 验证分支事务操作:RM可以是AT,TCC或者XA,制造一些回滚/提交重试的场景进行删除分支事务操作的三个操作
  6. 验证全局事务操作:RM可以是AT,TCC,XA以及SAGA,制造一些回滚/提交重试的场景进行删除全局事务的操作

Ⅴ. Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Sep 17, 2023

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #5856 (0412b1c) into 2.x (6d4ab48) will decrease coverage by 0.12%.
The diff coverage is 37.72%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5856      +/-   ##
============================================
- Coverage     48.08%   47.96%   -0.12%     
- Complexity     4614     4684      +70     
============================================
  Files           911      924      +13     
  Lines         31285    31886     +601     
  Branches       3768     3855      +87     
============================================
+ Hits          15042    15293     +251     
- Misses        14727    15050     +323     
- Partials       1516     1543      +27     
Files Coverage Δ
...c/main/java/io/seata/common/ConfigurationKeys.java 0.00% <ø> (ø)
...ommon/src/main/java/io/seata/common/Constants.java 100.00% <ø> (ø)
...n/src/main/java/io/seata/common/DefaultValues.java 0.00% <ø> (ø)
...seata/core/exception/TransactionExceptionCode.java 100.00% <100.00%> (ø)
...rc/main/java/io/seata/core/model/BranchStatus.java 100.00% <100.00%> (ø)
...rc/main/java/io/seata/core/model/GlobalStatus.java 79.06% <100.00%> (+1.56%) ⬆️
...io/seata/core/rpc/netty/RmNettyRemotingClient.java 38.80% <100.00%> (+0.92%) ⬆️
...lizer/protobuf/manager/ProtobufConvertManager.java 100.00% <100.00%> (ø)
...io/seata/serializer/seata/MessageCodecFactory.java 84.29% <100.00%> (+1.11%) ⬆️
...er/console/impl/db/BranchSessionDBServiceImpl.java 0.00% <ø> (ø)
... and 41 more

... and 5 files with indirect coverage changes

@wangliang181230 wangliang181230 self-requested a review October 7, 2023 05:57
@slievrly slievrly added this to the Summer Code 2023 milestone Oct 19, 2023
@wangliang181230 wangliang181230 changed the base branch from 2.x to summer-code_trxOPS October 24, 2023 06:44
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

…gth_console

# Conflicts:
#	core/src/main/java/io/seata/core/protocol/transaction/RMInboundHandler.java
#	server/src/main/java/io/seata/server/session/GlobalSession.java
#	server/src/main/java/io/seata/server/session/SessionHolder.java
#	server/src/main/java/io/seata/server/storage/SessionConverter.java
#	server/src/test/java/io/seata/server/session/FileSessionManagerTest.java
@wangliang181230 wangliang181230 changed the base branch from summer-code_trxOPS to 2.x October 29, 2023 20:47
@wangliang181230 wangliang181230 changed the base branch from 2.x to summer-code_trxOPS October 29, 2023 20:50
@wangliang181230 wangliang181230 changed the base branch from summer-code_trxOPS to 2.x October 29, 2023 21:07
@wangliang181230 wangliang181230 changed the base branch from 2.x to summer-code_trxOPS October 29, 2023 21:34
@wangliang181230 wangliang181230 merged commit 91d20c8 into apache:summer-code_trxOPS Oct 29, 2023
7 checks passed
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.

4 participants