xiaoxiangyeyu0 commented on issue #7682:
URL: 
https://github.com/apache/incubator-seata/issues/7682#issuecomment-3388117214

   > > > > pinGlobalTxToPhysicalConnection是什么配置,可以贴一下内存溢出的堆栈吗?
   > > > 
   > > > 
   > > > pinGlobalTxToPhysicalConnection 是 MySQL JDBC 驱动提供的参数,用于确保 XA 
模式下事务一致性。二阶段提交的时候 会根据xid来remove掉连接对象。seata上层透传的xid对象没有重写hashcode导致内存泄漏
   > > 
   > > 
   > > 还是想了解下为什么加了pinGlobalTxToPhysicalConnection就会内存溢出,是什么原因导致的
   > 
   > 
`pinGlobalTxToPhysicalConnection=true`时会使用`com.mysql.cj.jdbc.SuspendableXAConnection`,
 seata上层透传的xid对象没有重写hashcode导致XIDS_TO_PHYSICAL_CONNECTIONS无法正确删除连接
   > 
   > <img alt="Image" width="698" height="362" 
src="https://private-user-images.githubusercontent.com/48050611/499651255-4cb7aa82-ed1e-41a0-a410-b7d60d948f22.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjAwNjU0NTAsIm5iZiI6MTc2MDA2NTE1MCwicGF0aCI6Ii80ODA1MDYxMS80OTk2NTEyNTUtNGNiN2FhODItZWQxZS00MWEwLWE0MTAtYjdkNjBkOTQ4ZjIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDEwVDAyNTkxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYyY2U1NzU5NmI3MWQ1ZDZkYjA2ZGM5ODVhYzhjNDIwYWY3NGQ3ZGRiYzA1MjA3OGQ0NjFmOGE5ZjM1ODc3NWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.jw69x7Rtvov-SIYQm2ONhUe4IK9FBm1n-fzW_3qSxwg";>
 <img alt="Image" width="813" height="324" 
src="https://private-user-images.githubusercontent.com/48050611/499651353-338a25a6-795c-46ac-bc8f-c66be2efcc69.png?jwt=eyJ0
 
eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjAwNjU0NTAsIm5iZiI6MTc2MDA2NTE1MCwicGF0aCI6Ii80ODA1MDYxMS80OTk2NTEzNTMtMzM4YTI1YTYtNzk1Yy00NmFjLWJjOGYtYzY2YmUyZWZjYzY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDEwVDAyNTkxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVlMzM0ZTEzNzY2NDg1MWU5ZmVmNzdmMmY5Y2Q3YTkwODAzOWI3ODY1NGU1MDFjZWY0ZGZhZTI5ZDE4MjE2YjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QZS5G9ixdrNOpV1hu50Px-B04zDgB2EpD8F7MauD6Hc">
   
   xaCommit能否和xaRollback一样,先判断当前的xaBranchXid是否为空来解决就行了,之前我在pg超时回滚也遇到过这个问题,在
   
org.postgresql.xa.PGXAConnection.rollback(Xid)会调用equals方法判断是否同一connection。https://github.com/apache/incubator-seata/issues/6814
   
   <img width="1027" height="854" alt="Image" 
src="https://github.com/user-attachments/assets/d9dbf378-7baa-4667-a2a5-2d7f2656d304";
 />


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to