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

bugfix: fix readonly branch commit errors in Oracle XA transactions. #6707

Merged
merged 14 commits into from
Jul 30, 2024

Conversation

gongycn
Copy link
Contributor

@gongycn gongycn commented Jul 29, 2024

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

fix the issue of readonly branch commit errors in Oracle XA transactions, which leads to long-running transactions being unable to commit and causing unreadable states.
Solution Logic:
When the database is Oracle and the prepare result is XA_RDONLY, notify TC that the current branch status is BranchStatus.PhaseOne_RDONLY (a newly added state to address this issue). During global commit, for branches with this status type, delete the branch log directly and ignore it.

Ⅱ. Does this pull request fix one issue?

fixes #6512
Original pull request: #6629

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

Ⅳ. Describe how to verify it

Based on the problematic local project instance, the verification includes:

Whether the Seata TC frontend displays normally;
In Seata TM managing multiple RMs, whether it functions correctly when there is one or more readonly branches; whether it functions correctly when there are no readonly branches; and whether it functions correctly when there are only one or more readonly branches.

Ⅴ. Special notes for reviews

@gongycn
Copy link
Contributor Author

gongycn commented Jul 29, 2024

@funky-eyes Accidentally closed #6629 due to misoperation, resubmitted here.

@funky-eyes funky-eyes added this to the 2.2.0 milestone Jul 29, 2024
@funky-eyes funky-eyes added type: bug Category issues or prs related to bug. first-time contributor first-time contributor module/rm-datasource rm-datasource module module/server server module labels Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 50.47%. Comparing base (7d3cf99) to head (484cc78).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6707      +/-   ##
============================================
- Coverage     50.47%   50.47%   -0.01%     
+ Complexity     5831     5830       -1     
============================================
  Files          1051     1051              
  Lines         36340    36347       +7     
  Branches       4319     4325       +6     
============================================
+ Hits          18342    18345       +3     
+ Misses        16183    16181       -2     
- Partials       1815     1821       +6     
Files Coverage Δ
...java/org/apache/seata/core/model/BranchStatus.java 100.00% <100.00%> (ø)
...ache/seata/rm/datasource/xa/ConnectionProxyXA.java 55.68% <33.33%> (-0.68%) ⬇️
...g/apache/seata/server/coordinator/DefaultCore.java 47.15% <0.00%> (-1.10%) ⬇️

... and 3 files with indirect coverage changes

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 merged commit da9e99b into apache:2.x Jul 30, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor module/rm-datasource rm-datasource module module/server server module type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XA事务模式下写入的查询不到问题探讨
2 participants