Repository navigation
Conversation
funky-eyes
left a comment
There was a problem hiding this comment.
Reviewed HEAD 88e3e16dafa8b4ba83ccedcf415bb337b95f6275 against merge base a9b03977be324c170741ebc37d797d5bfd159552.
Requesting changes for the two inline issues: valid long XIDs can fail after branch registration and remain unresolvable through the new encoder, and pre-upgrade DM prepared branches cannot be reconstructed with their original physical XA identity.
Please also provide a minimal real-DM reproduction or integration test for #8310. The reported stack fails in DmdbXAResource.end(), whereas the PR describes rejection in start(). That does not disprove the proposed cause, but the current byte-array tests do not establish it. Compare shared-gtrid/different-bqual branches against the new encoding on the same DM instance, record the failing XA call/error code and server/driver versions, and verify commit and rollback, including RM restart.
Validation: compiled the PR's actual Xid sources, executed all 8 existing methods in XAXidBuilderTest and XABranchXidTest with their JUnit assertions (all passed), reproduced the 62-byte-to-81-byte IPv6 failure, and checked that legacy prepare/new-DM phase-two produce different physical Xid tuples. No real DM database or full Maven suite was run. The multi-schema resourceId collision predates this PR and is not included as a regression finding.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 2.x #8312 +/- ##
============================================
+ Coverage 79.84% 79.87% +0.03%
+ Complexity 1162 1160 -2
============================================
Files 1400 1400
Lines 53011 53046 +35
Branches 6349 6357 +8
============================================
+ Hits 42325 42371 +46
+ Misses 7729 7723 -6
+ Partials 2957 2952 -5
🚀 New features to boost your workflow:
|


Ⅰ. Describe what this PR did
DM rejects a new xa start with XAER_RMERR while an in-doubt (prepared) branch of the same gtrid exists on the instance, so two branches of one Seata global transaction cannot hit the same DM instance in XA mode.
For dbType=dm, qualify the XA gtrid with the branch id (gtrid = xid + "-" + branchId, formatId 9753) so every branch owns a distinct gtrid. The legacy format (formatId 9752, gtrid = xid) is kept byte-for-byte for every other database.
Ⅱ. Does this pull request fix one issue?
fix #8310
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews