You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "tachibana22 (via GitHub)" <gi...@apache.org> on 2026/09/20 09:22:43 UTC

Re: [PR] fix(tm): isolate nested global transaction context so the outer launcher commits [incubator-seata-go]

tachibana22 commented on PR #1161:
URL: https://github.com/apache/incubator-seata-go/pull/1161#issuecomment-5748925913

   Thanks for the thorough review and detailed feedback @Ethan-Xingyue. All items have been addressed in the latest commit:
   
   ### Must fix
   1. **Eliminated slice index panic**: Removed the duplicate `TestNestedRequiredMustCommitOuterTransaction`. All matrix test assertions now use whole-slice comparisons (`assert.Equal(t, tt.wantCommits, committedXids)`), preventing test runner panics on failure paths.
   2. **Direct context state assertions & expanded matrix**:
      - Added direct checks for `tm.GetXID(ctx) == "xid-1"` and `*tm.GetTxRole(ctx) == tm.Launcher` immediately after the inner transaction returns in the outer callback, fulfilling acceptance criterion 3 of #1155.
      - Added `wantInnerXid` and `wantInnerRole` fields to `testMatrixCase` and directly asserted them on `innerCtx`.
      - Expanded the matrix to 17 test cases by adding `Required_RequiresNew_InnerPanic`, as well as error/panic scenarios for `NotSupported`, `Supports`, and `Mandatory`.
   3. **Removed dead code**: Completely deleted `ClearTxConf` and its unit test `TestClearTxConf` to eliminate dead code and protect against future regressions.
   4. **Changelog & Release note**:
      - Registered the fix under `### bugfix:` in both `changes/dev.md` and `changes/dev_zh.md`.
      - Updated the PR description with the user-visible release note and rebased the branch onto latest master.
   
   ### Nits
   - **Title**: Updated to `fix(tm): isolate nested global transaction context so the outer launcher commits`.
   - **Comment**: Expanded the comment in `transaction_executor.go` to explicitly document the full isolation scope, including role, XID unbinding protection in `RequiresNew`/`NotSupported`, name, status, and `timeInfo`.
   - **Matrix cleanup**: Removed `wantOuterErr: false`, explicit `nil` slices, and simplified `tt.innerAction` execution.
   - **Description**: Documented the dangling `[xid-2, xid-2]` commit and wrongful `xid-2` rollback behaviors observed on unfixed master.
   
   All 17 matrix test cases pass locally. Ready for another round of review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org