From 87c88e4226c1dda90a808356e5ab328c187cf7a2 Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 16:32:06 +0800 Subject: [PATCH 1/7] merge --- changes/en-us/2.x.md | 200 +++++++++++++++++++++++++++--------------- changes/zh-cn/2.x.md | 204 ++++++++++++++++++++++++++++--------------- 2 files changed, 266 insertions(+), 138 deletions(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index ed7de433ea0..4ad92ff7774 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -3,92 +3,156 @@ Add changes here for all PR submitted to the 2.x branch. ### feature: -- [[#6904](https://github.com/apache/incubator-seata/pull/6904)] add fastjson2 serializer support -- [[#6876](https://github.com/apache/incubator-seata/pull/6876)] support kingbase -- [[#6881](https://github.com/apache/incubator-seata/pull/6881)] support grpc -- [[#6864](https://github.com/apache/incubator-seata/pull/6864)] support shentong database -- [[#6974](https://github.com/apache/incubator-seata/pull/6974)] support fastjson2 undolog parser -- [[#6992](https://github.com/apache/incubator-seata/pull/6992)] support grpc serializer -- [[#6926](https://github.com/apache/incubator-seata/pull/6926)] support ssl communication for raft nodes - +- [[#6536](https://github.com/apache/incubator-seata/pull/6536)] support naming server client +- [[#6226](https://github.com/apache/incubator-seata/pull/6226)] multi-version seata protocol support +- [[#6537](https://github.com/apache/incubator-seata/pull/6537)] support Namingserver +- [[#6538](https://github.com/apache/incubator-seata/pull/6538)] Integration of naming server on the Seata server side +- [[#6766](https://github.com/apache/incubator-seata/pull/6766)] add TCC three-phase hooks ### bugfix: -- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] fix file.conf read failed after package -- [[#6890](https://github.com/apache/incubator-seata/pull/6890)] fix designerJson to standardJson: subStateMachine compensateState cannot be recognized -- [[#6907](https://github.com/apache/incubator-seata/pull/6907)] fix the issue of Codecov not generating reports -- [[#6923](https://github.com/apache/incubator-seata/pull/6923)] Enhance 401 Error Handling by Refreshing Token -- [[#6925](https://github.com/apache/incubator-seata/pull/6925)] fix the issue in Raft model a follower's crash may lead to the continued use of expired tokens -- [[#6932](https://github.com/apache/incubator-seata/pull/6932)] when enabling local transactions, the lock contention failure in file & raft mode does not exit, leading to a lingering lock -- [[#6940](https://github.com/apache/incubator-seata/pull/6940)] Fix NacosRegistry lookup behavior transactionServiceGroup is empty causing NPE error -- [[#6943](https://github.com/apache/incubator-seata/pull/6943)] fix the conversion error for `convertBranchSession` in concurrent environment. -- [[#6948](https://github.com/apache/incubator-seata/pull/6948)] Fix the CI build issue on the ARM64 platform -- [[#6947](https://github.com/apache/incubator-seata/pull/6947)] fix npe for nacos registry when look up address -- [[#6984](https://github.com/apache/incubator-seata/pull/6984)] support building docker image on openjdk23 -- [[#6994](https://github.com/apache/incubator-seata/pull/6994)] fix the problem of building undoLog exception when update join does not update data -- [[#7005](https://github.com/apache/incubator-seata/pull/7005)] fix the Raft NPE issue caused by two-phase concurrency -- [[#7010](https://github.com/apache/incubator-seata/pull/7010)] fix error while the "context" is key word in DM8 when delete undolog -- [[#7022](https://github.com/apache/incubator-seata/pull/7022)] fix `store.mode` property in `application.raft.example.yml` -- [[#7025](https://github.com/apache/incubator-seata/pull/7025)] fix vGroupMappingManager is NOT init -- +- [[#6592](https://github.com/apache/incubator-seata/pull/6592)] fix @Async annotation not working in ClusterWatcherManager +- [[#6624](https://github.com/apache/incubator-seata/pull/6624)] fix Alibaba Dubbo convert error +- [[#6627](https://github.com/apache/incubator-seata/pull/6627)] fix the issue of xaEnded not being reset +- [[#6626](https://github.com/apache/incubator-seata/pull/6626)] fix hsf ConsumerModel convert error +- [[#6816](https://github.com/apache/incubator-seata/pull/6816)] Fix NPE when getting branchType in a non-global transaction context +- [[#6642](https://github.com/apache/incubator-seata/pull/6642)] codecov token not found +- [[#6661](https://github.com/apache/incubator-seata/pull/6661)] fix `tableMeta` cache scheduled refresh issue +- [[#6486](https://github.com/apache/incubator-seata/pull/6486)] fix mysql undo log update sql data more than max allowed packet +- [[#6668](https://github.com/apache/incubator-seata/pull/6668)] thread safety issue when adding and removing instances +- [[#6678](https://github.com/apache/incubator-seata/pull/6678)] fix the same record has different lowkeys due to mixed case of table names yesterday +- [[#6697](https://github.com/apache/incubator-seata/pull/6697)] v0 ByteBuf should not decode by super class +- [[#6707](https://github.com/apache/incubator-seata/pull/6707)] fix readonly branch commit errors in Oracle XA transactions +- [[#6711](https://github.com/apache/incubator-seata/pull/6711)] fix dameng rollback info un compress fail +- [[#6714](https://github.com/apache/incubator-seata/pull/6714)] fix dameng delete undo fail +- [[#6511](https://github.com/apache/incubator-seata/pull/6511)] fix the failure of rollbacking back of the delete SQL at AT mode when using SQLServer +- [[#6701](https://github.com/apache/incubator-seata/pull/6728)] fix support serialization for dm.jdbc.driver.DmdbTimestamp +- [[#6757](https://github.com/apache/incubator-seata/pull/6757)] the bug where multiple nodes cannot be retrieved from the naming server +- [[#6769](https://github.com/apache/incubator-seata/pull/6769)] fix tcc fence deadLock +- [[#6778](https://github.com/apache/incubator-seata/pull/6778)] fix namingserver node term +- [[#6765](https://github.com/apache/incubator-seata/pull/6765)] fix MySQL driver loading by replacing custom classloader with system classloader for better compatibility and simplified process +- [[#6781](https://github.com/apache/incubator-seata/pull/6781)] the issue where the TC occasionally fails to go offline from the NamingServer +- [[#6785](https://github.com/apache/incubator-seata/pull/6785)] fix prometheus fail to return seata metrics data when using Nacos +- [[#6797](https://github.com/apache/incubator-seata/pull/6797)] fall back to any of available cluster address when query cluster address is empty +- [[#6800](https://github.com/apache/incubator-seata/pull/6800)] make exception message generic for all database drivers +- [[#6759](https://github.com/apache/incubator-seata/pull/6759)] fix the error of active refresh failure of cross-database table metadata +- [[#6812](https://github.com/apache/incubator-seata/pull/6812)] bugfix: change group and node offline status are not pushed in real time +- [[#6817](https://github.com/apache/incubator-seata/pull/6817)] bugfix: fix namingserver changVgroup failed +- [[#6820](https://github.com/apache/incubator-seata/pull/6820)] Fix file path error in the Dockerfile +- [[#6825](https://github.com/apache/incubator-seata/pull/6825)] Fix the issue of XA mode transaction timeout and inability to roll back in Postgres +- [[#6833](https://github.com/apache/incubator-seata/pull/6833)] SQLIntegrityConstraintViolationException capture incorrectly when inserting a globallock +- [[#6835](https://github.com/apache/incubator-seata/pull/6835)] Fix the issue of missing request body of post method in HttpClientUtil +- [[#6845](https://github.com/apache/incubator-seata/pull/6845)] fix rocksDB opens the same file multiple times +- [[#6840](https://github.com/apache/incubator-seata/pull/6840)] Fix the issue of unsafe deserialization in ProcessorYaml.java +- [[#6843](https://github.com/apache/incubator-seata/pull/6843)] Fix 403 error when sending a POST request from the console +- [[#6850](https://github.com/apache/incubator-seata/pull/6850)] raft mode is backward compatible with version 2.0 +- [[#6855](https://github.com/apache/incubator-seata/pull/6855)] after scaling down a Raft cluster, the metadata still contains the removed node +- [[#6859](https://github.com/apache/incubator-seata/pull/6859)] remove duplicated dependency in pom + + ### optimize: -- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction -- [[#6874](https://github.com/apache/incubator-seata/pull/6874)] modify the version to 2.3.0-SNAPSHOT -- [[#6892](https://github.com/apache/incubator-seata/pull/6892)] upgrade npmjs version in console module -- [[#6883](https://github.com/apache/incubator-seata/pull/6874)] remove write only object -- [[#6892](https://github.com/apache/incubator-seata/pull/6892)] upgrade npmjs version -- [[#6889](https://github.com/apache/incubator-seata/pull/6889)] Correct word spelling errors -- [[#6898](https://github.com/apache/incubator-seata/pull/6898)] upgrade npmjs version in saga module -- [[#6879](https://github.com/apache/incubator-seata/pull/6879)] fix log argument mismatch issue -- [[#6902](https://github.com/apache/incubator-seata/pull/6900)] optimize readme docs -- [[#6807](https://github.com/apache/incubator-seata/pull/6807)] splitting MergedWarpMessage enhances the server parallel processing capability -- [[#6905](https://github.com/apache/incubator-seata/pull/6905)] remove incompatible licenses at build time -- [[#6906](https://github.com/apache/incubator-seata/pull/6906)] h2 dependency adds test scope -- [[#6911](https://github.com/apache/incubator-seata/pull/6911)] fix some typos in project -- [[#6918](https://github.com/apache/incubator-seata/pull/6918)] Use the openjdk image of eclipse-temurin as the base image -- [[#6938](https://github.com/apache/incubator-seata/pull/6938)] Update online chat information in README.md -- [[#6950](https://github.com/apache/incubator-seata/pull/6950)] Remove JVM parameter app.id -- [[#6959](https://github.com/apache/incubator-seata/pull/6959)] update the naming and description for the `seata-http-jakarta` module -- [[#6991](https://github.com/apache/incubator-seata/pull/6991)] gRPC serialization default to Protobuf -- [[#6993](https://github.com/apache/incubator-seata/pull/6993)] optimize transaction metrics -- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] upgrade outdate npmjs dependencies -- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] optimize lock release logic in AT transaction mode -- [[#7023](https://github.com/apache/incubator-seata/pull/7023)] optimize fail fast, when all server not available -- [[#7027](https://github.com/apache/incubator-seata/pull/7027)] raft mode maintains the reload logic consistent with the file -- [[#6891](https://github.com/apache/incubator-seata/pull/6891)] add StateType Enum +- [[#6499](https://github.com/apache/incubator-seata/pull/6499)] split the task thread pool for committing and rollbacking statuses +- [[#6208](https://github.com/apache/incubator-seata/pull/6208)] optimize : load SeataSerializer by version +- [[#6209](https://github.com/apache/incubator-seata/pull/6209)] Eliminate RpcMessage and Encoder/Decoder dependencies +- [[#6634](https://github.com/apache/incubator-seata/pull/6634)] select channel handles based on protocol versions +- [[#6523](https://github.com/apache/incubator-seata/pull/6523)] upgrade alibaba/druid version to 1.2.20 +- [[#6566](https://github.com/apache/incubator-seata/pull/6566)] Add support for configuring exposeProxy in GlobalTransactionScanner +- [[#6534](https://github.com/apache/incubator-seata/pull/6534)] optimize: send async response +- [[#6640](https://github.com/apache/incubator-seata/pull/6640)] modify codecov config +- [[#6640](https://github.com/apache/incubator-seata/pull/6648)] add license header +- [[#6666](https://github.com/apache/incubator-seata/pull/6666)] add ExceptionUtil class for unwarp error msg +- [[#6654](https://github.com/apache/incubator-seata/pull/6654)] add Namingserver package module +- [[#6667](https://github.com/apache/incubator-seata/pull/6667)] optimize Namingserver log output +- [[#6687](https://github.com/apache/incubator-seata/pull/6687)] delete static code built on the frontend +- [[#6700](https://github.com/apache/incubator-seata/pull/6700)] remove sdk version checking +- [[#6727](https://github.com/apache/incubator-seata/pull/6727)] deserialize performance optimize +- [[#6732](https://github.com/apache/incubator-seata/pull/6732)] add the default console and security config on application.example.yml and application.raft.example.yml +- [[#6651](https://github.com/apache/incubator-seata/pull/6651)] add license header for proto file +- [[#6653](https://github.com/apache/incubator-seata/pull/6653)] optimize multiple licenses and remove license urls +- [[#6655](https://github.com/apache/incubator-seata/pull/6655)] update front-end license +- [[#6652](https://github.com/apache/incubator-seata/pull/6673)] add license header for spring config file +- [[#6674](https://github.com/apache/incubator-seata/pull/6674)] update source license +- [[#6650](https://github.com/apache/incubator-seata/pull/6650)] add license header for SPI file +- [[#6741](https://github.com/apache/incubator-seata/pull/6741)] upgrade tomcat-embed-core to 9.0.90 +- [[#6742](https://github.com/apache/incubator-seata/pull/6742)] upgrade npmjs version in console +- [[#6743](https://github.com/apache/incubator-seata/pull/6743)] upgrade npmjs version in saga +- [[#6746](https://github.com/apache/incubator-seata/pull/6746)] optimize compatible dependencies +- [[#6745](https://github.com/apache/incubator-seata/pull/6745)] fix node-gyp build error on arm64 and macos +- [[#6749](https://github.com/apache/incubator-seata/pull/6749)] optimize WebSecurityConfig csrf +- [[#6748](https://github.com/apache/incubator-seata/pull/6748)] optimize ConsistentHashLoadBalance Algorithm +- [[#6747](https://github.com/apache/incubator-seata/pull/6747)] optimize fastjson deserialization +- [[#6755](https://github.com/apache/incubator-seata/pull/6755)] optimize namingserver code logic +- [[#6763](https://github.com/apache/incubator-seata/pull/6763)] optimize NacosConfiguration singleton reload +- [[#6761](https://github.com/apache/incubator-seata/pull/6761)] optimize the namingserver code to improve readability +- [[#6768](https://github.com/apache/incubator-seata/pull/6768)] report the tcc fence transaction isolation level +- [[#6770](https://github.com/apache/incubator-seata/pull/6770)] Automatic deletion of namingserver vgroup through Caffeine map +- [[#6780](https://github.com/apache/incubator-seata/pull/6780)] optimize the reflection operation in class `SerializerServiceLoader` +- [[#6784](https://github.com/apache/incubator-seata/pull/6784)] upgrade axios to 1.7.4 +- [[#6787](https://github.com/apache/incubator-seata/pull/6787)] upgrade elliptic to 6.5.7 +- [[#6783](https://github.com/apache/incubator-seata/pull/6783)] rename the server naming/v1 api to vgroup/v1 +- [[#6793](https://github.com/apache/incubator-seata/pull/6793)] fix npmjs conflicts +- [[#6793](https://github.com/apache/incubator-seata/pull/6795)] optimize the initialization logic for server meta +- [[#6794](https://github.com/apache/incubator-seata/pull/6794)] optimize NacosMockTest UT case +- [[#6806](https://github.com/apache/incubator-seata/pull/6806)] optimize `tableMeta` cache scheduled refresh issue +- [[#6808](https://github.com/apache/incubator-seata/pull/6808)] change version to 2.2.0-SNAPSHOT +- [[#6819](https://github.com/apache/incubator-seata/pull/6819)] merge the packaging processes of namingserver and seata-server +- [[#6827](https://github.com/apache/incubator-seata/pull/6827)] rename namingserver registry type +- [[#6836](https://github.com/apache/incubator-seata/pull/6836)] add independent nacos for the CI process +- [[#6841](https://github.com/apache/incubator-seata/pull/6841)] update the LICENSE and NOTICE files and standardize dependency versions +- [[#6823](https://github.com/apache/incubator-seata/pull/6823)] fix typo +- [[#6779](https://github.com/apache/incubator-seata/pull/6779)] use curator instead of zkclient in config model +- [[#6831](https://github.com/apache/incubator-seata/pull/6831)] use curator instead of zkclient in registry model +- [[#6852](https://github.com/apache/incubator-seata/pull/6852)] optimize raft metadata api ### refactor: -- [[#7017](https://github.com/apache/incubator-seata/pull/7017)] remove dependency on seata-server module +### security: ### test: -- [[#6869](https://github.com/apache/incubator-seata/pull/6869)] Add unit tests for the `seata-core` module -- [[#6927](https://github.com/apache/incubator-seata/pull/6927)] Add unit tests for the `seata-rocketmq` module -- [[#7018](https://github.com/apache/incubator-seata/pull/7018)] Add unit tests for the `seata-tm` module -- [[#7030](https://github.com/apache/incubator-seata/pull/7030)] Add unit tests for the `seata-common` module +- [[#6533](https://github.com/apache/incubator-seata/pull/6533)] increase integration-tx-api module unit test coverage +- [[#6608](https://github.com/apache/incubator-seata/pull/6608)] add unit test for sql-parser-core +- [[#6647](https://github.com/apache/incubator-seata/pull/6647)] improve the test case coverage of saga module to 70% +- [[#6695](https://github.com/apache/incubator-seata/pull/6695)] old version(< 0.7.1) client test case for multi-version protocol +- [[#6752](https://github.com/apache/incubator-seata/pull/6752)] Improve the test case coverage of metrics module +- [[#6764](https://github.com/apache/incubator-seata/pull/6764)] add Apollo mock test case +- [[#6750](https://github.com/apache/incubator-seata/pull/6750)] increase spring autoconfigure module unit test converage +- [[#6773](https://github.com/apache/incubator-seata/pull/6773)] fix the wrong code coverage from codecov icon in default branch +- [[#6821](https://github.com/apache/incubator-seata/pull/6821)] fix the test case assertions +- [[#6803](https://github.com/apache/incubator-seata/pull/6803)] optimize: compilation and packaging for the ARM64 architecture + Thanks to these contributors for their code commits. Please report an unintended omission. - [slievrly](https://github.com/slievrly) -- [GoodBoyCoder](https://github.com/GoodBoyCoder) +- [tuwenlin](https://github.com/tuwenlin) +- [YeonCheolGit](https://github.com/YeonCheolGit) +- [liuqiufeng](https://github.com/liuqiufeng) +- [God-Gan](https://github.com/God-Gan) +- [Bughue](https://github.com/Bughue) - [funky-eyes](https://github.com/funky-eyes) -- [dk2k](https://github.com/dk2k) -- [MaoMaoandSnail](https://github.com/MaoMaoandSnail) -- [yougecn](https://github.com/yougecn) -- [arrrnold17](https://github.com/arrrnold17) +- [tanyaofei](https://github.com/tanyaofei) +- [traitsisgiorgos](https://github.com/traitsisgiorgos) +- [wanghongzhou](https://github.com/wanghongzhou) +- [ggbocoder](https://github.com/ggbocoder) +- [azatyamanaev](https://github.com/azatyamanaev) - [xjlgod](https://github.com/xjlgod) -- [PleaseGiveMeTheCoke](https://github.com/PleaseGiveMeTheCoke) -- [dsomehan](https://github.com/dsomehan) -- [psxjoy](https://github.com/psxjoy) - [xingfudeshi](https://github.com/xingfudeshi) -- [o-jimin](https://github.com/o-jimin) -- [lixingjia77](https://github.com/lixingjia77) -- [whaon](https://github.com/whaon) -- [YvCeung](https://github.com/YvCeung) +- [wuwen5](https://github.com/wuwen5) - [jsbxyyx](https://github.com/jsbxyyx) +- [iAmClever](https://github.com/iAmClever) +- [GoodBoyCoder](https://github.com/GoodBoyCoder) +- [liuqiufeng](https://github.com/liuqiufeng) +- [caohdgege](https://github.com/caohdgege) +- [TakeActionNow2019](https://github.com/TakeActionNow2019) +- [imashimaro](https://github.com/hmj776521114) +- [lyl2008dsg](https://github.com/lyl2008dsg) - [lightClouds917](https://github.com/lightClouds917) -- [Muluo-cyan](https://github.com/Muluo-cyan) -- [MaoMaoandSnail](https://github.com/MaoMaoandSnail) +- [l81893521](https://github.com/l81893521) +- [laywin](https://github.com/laywin) +- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0) +- [LegGasai](https://github.com/LegGasai) +- [yangli-stu](https://github.com/yangli-stu) +- [heliang666s](https://github.com/heliang666s) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 9abe2b6929b..a6e967a0b0b 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -3,96 +3,160 @@ ### feature: -- [[#6904](https://github.com/apache/incubator-seata/pull/6904)] 增加Fastjson2序列化Rpc消息支持 -- [[#6876](https://github.com/apache/incubator-seata/pull/6876)] 支持人大金仓数据库(kingbase) -- [[#6881](https://github.com/apache/incubator-seata/pull/6881)] client和server支持grpc协议 -- [[#6864](https://github.com/apache/incubator-seata/pull/6864)] 支持神通数据库(oscar) -- [[#6974](https://github.com/apache/incubator-seata/pull/6974)] 支持UndoLog的fastjson2序列化方式 -- [[#6992](https://github.com/apache/incubator-seata/pull/6992)] 支持grpc序列化器 -- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] 升级过时的 npmjs 依赖 -- [[#6926](https://github.com/apache/incubator-seata/pull/6926)] 支持Raft节点间的SSL通信 +- [[#6536](https://github.com/apache/incubator-seata/pull/6536)] 支持 naming server客户端 +- [[#6226](https://github.com/apache/incubator-seata/pull/6226)] 支持seata私有协议多版本兼容 +- [[#6537](https://github.com/apache/incubator-seata/pull/6537)] 支持 Namingserver +- [[#6538](https://github.com/apache/incubator-seata/pull/6538)] seata server端集成naming server +- [[#6766](https://github.com/apache/incubator-seata/pull/6766)] 添加tcc三阶段钩子函数,方便用户拓展业务逻辑(比如多数据源情况下可以用于切换数据源) ### bugfix: -- [[#6899](https://github.com/apache/incubator-seata/pull/6899)] 修复file.conf打包后的读取 -- [[#6890](https://github.com/apache/incubator-seata/pull/6890)] 修复saga设计json转标准json过程中: 子状态机补偿节点无法被识别 -- [[#6907](https://github.com/apache/incubator-seata/pull/6907)] 修复Codecov未生成报告的问题 -- [[#6923](https://github.com/apache/incubator-seata/pull/6923)] 增强 401 错误处理,通过刷新令牌 -- [[#6925](https://github.com/apache/incubator-seata/pull/6925)] 修复Raft模式下,Follower崩溃可能导致Client继续使用过期令牌的问题 -- [[#6932](https://github.com/apache/incubator-seata/pull/6932)] 修复开启本地事务时file&raft模式下锁争抢失败未退出导致可能出现残留锁 -- [[#6940](https://github.com/apache/incubator-seata/pull/6940)] 修复NacosRegistry lookup 行为 transactionServiceGroup 为空导致 NPE 错误 -- [[#6943](https://github.com/apache/incubator-seata/pull/6943)] 修复并发状态下 `convertBranchSession` 转换报错问题 -- [[#6948](https://github.com/apache/incubator-seata/pull/6948)] 修复在ARM64平台下CI构建出错的问题 -- [[#6947](https://github.com/apache/incubator-seata/pull/6947)] 修复nacos注册中心查询可用地址时的空指针问题 -- [[#6984](https://github.com/apache/incubator-seata/pull/6984)] 修复 openjdk23 版本下无法构建 docker 镜像的问题 -- [[#6994](https://github.com/apache/incubator-seata/pull/6994)] 修复updateJoin语句未更新到数据时prepareUndoLog异常 -- [[#7005](https://github.com/apache/incubator-seata/pull/7005)] 修复Raft模式下两阶段并发可能导致NPE的问题 -- [[#7010](https://github.com/apache/incubator-seata/pull/7010)] 修复使用达梦数据库时删除undolog发生SQL语法错误 -- [[#7022](https://github.com/apache/incubator-seata/pull/7022)] 修复 `application.raft.example.yml`的 `store.mode`属性 -- [[#7025](https://github.com/apache/incubator-seata/pull/7025)] 修复vGroupMappingManager未初始化的问题 +- [[#6592](https://github.com/apache/incubator-seata/pull/6592)] fix @Async注解ClusterWatcherManager中不生效的问题 +- [[#6624](https://github.com/apache/incubator-seata/pull/6624)] 修复 Alibaba Dubbo 转换错误 +- [[#6627](https://github.com/apache/incubator-seata/pull/6627)] 修复 xaEnded 没有重置 +- [[#6626](https://github.com/apache/incubator-seata/pull/6626)] 修复 hsf ConsumerModel 转换错误 +- [[#6816](https://github.com/apache/incubator-seata/pull/6816)] 修复在非全局事务上下文中获取branchType时的NPE问题 +- [[#6640](https://github.com/apache/incubator-seata/pull/6640)] 优化codecov相关配置 +- [[#6642](https://github.com/apache/incubator-seata/pull/6642)] 修复codecov token找不到导致无法提交单测覆盖度报告 +- [[#6661](https://github.com/apache/incubator-seata/pull/6661)] 修复`tableMeta`缓存定时刷新失效问题 +- [[#6486](https://github.com/apache/incubator-seata/pull/6486)] 修复在mysql数据库下undo_log sql数据超过最大包大小错误 +- [[#6668](https://github.com/apache/incubator-seata/pull/6668)] 解决namingserver同一个集群下instance添加和删除时的线程安全问题 +- [[#6678](https://github.com/apache/incubator-seata/pull/6678)] 修复由于表名大小写问题导致的相同记录生成不同RowKey的问题 +- [[#6697](https://github.com/apache/incubator-seata/pull/6697)] v0版本的ByteBuf不应由父类先解码 +- [[#6707](https://github.com/apache/incubator-seata/pull/6707)] 修复Oracle XA事务中只读分支提交出错的问题 +- [[#6711](https://github.com/apache/incubator-seata/pull/6711)] 修复达梦数据库的getRollbackInfo没有解压缩的问题 +- [[#6714](https://github.com/apache/incubator-seata/pull/6714)] 修复达梦数据库的delete sql回滚失败的问题 +- [[#6511](https://github.com/apache/incubator-seata/pull/6511)] 修复在使用SQLServer时,AT模式delete语句无法正常回滚的问题 +- [[#6701](https://github.com/apache/incubator-seata/pull/6728)] 修复达梦数据库的对dm.jdbc.driver.DmdbTimestamp的支持 +- [[#6757](https://github.com/apache/incubator-seata/pull/6757)] 修复client通过namingserver只能获取到一个tc节点的bug +- [[#6769](https://github.com/apache/incubator-seata/pull/6769)] 修复tcc fence死锁 +- [[#6778](https://github.com/apache/incubator-seata/pull/6778)] 修复namingserver的节点term为0问题 +- [[#6765](https://github.com/apache/incubator-seata/pull/6765)] 改进MySQL驱动加载机制,将自定义类加载器替换为系统类加载器,更兼容简化流程 +- [[#6781](https://github.com/apache/incubator-seata/pull/6781)] 修复tc下线时,由于定时任务没有先关闭,导致下线后还会被注册上,需要靠namingserver的健康检查来下线的bug +- [[#6785](https://github.com/apache/incubator-seata/pull/6785)] 修复 prometheus 在与 Nacos 集成时无法返回 seata metrics 数据的问题 +- [[#6797](https://github.com/apache/incubator-seata/pull/6797)] 当查询的集群地址为空时,获取可用的任意集群地址 +- [[#6800](https://github.com/apache/incubator-seata/pull/6800)] 使异常消息对所有数据库驱动程序通用 +- [[#6812](https://github.com/apache/incubator-seata/pull/6812)] 修复切换事务分组和节点下线时namingserver没有实时感知和推送的bug +- [[#6759](https://github.com/apache/incubator-seata/pull/6759)] 修复跨库表主动刷新`tableMeta`的异常问题 +- [[#6817](https://github.com/apache/incubator-seata/pull/6817)] 修复namingserver切换事务分组失效的问题 +- [[#6820](https://github.com/apache/incubator-seata/pull/6820)] 修复Dockerfile得文件结构错误 +- [[#6825](https://github.com/apache/incubator-seata/pull/6825)] 修复Postgres的XA模式事务超时无法回滚问题 +- [[#6833](https://github.com/apache/incubator-seata/pull/6833)] 插入全局锁时 SQLIntegrityConstraintViolationException 捕获不正确 +- [[#6835](https://github.com/apache/incubator-seata/pull/6835)] 修复HttpClientUtil中post方法请求体缺失的问题 +- [[#6845](https://github.com/apache/incubator-seata/pull/6845)] 修复rocksdb open相同文件多次的问题 +- [[#6840](https://github.com/apache/incubator-seata/pull/6840)] 修复ProcessorYaml中不安全的反序列化 +- [[#6843](https://github.com/apache/incubator-seata/pull/6843)] 修复从控制台发送POST请求时出现的403错误 +- [[#6850](https://github.com/apache/incubator-seata/pull/6850)] raft模式向下兼容2.0版本 +- [[#6855](https://github.com/apache/incubator-seata/pull/6855)] 修复raft缩容后元数据中残留该节点的问题(需先升级到2.2再进行缩容) +- [[#6859](https://github.com/apache/incubator-seata/pull/6859)] 移除重复的依赖 ### optimize: -- [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作 -- [[#6874](https://github.com/apache/incubator-seata/pull/6874)] modify the version to 2.3.0-SNAPSHOT -- [[#6892](https://github.com/apache/incubator-seata/pull/6892)] 升级 console 模块 npmjs 版本 -- [[#6874](https://github.com/apache/incubator-seata/pull/6874)] 修改版本为2.3.0-SNAPSHOT -- [[#6883](https://github.com/apache/incubator-seata/pull/6874)] 删除代码中无用对象的创建 -- [[#6892](https://github.com/apache/incubator-seata/pull/6892)] 升级 npmjs 版本 -- [[#6889](https://github.com/apache/incubator-seata/pull/6889)] 修正单词拼写错误 -- [[#6898](https://github.com/apache/incubator-seata/pull/6898)] 升级 saga 模块 npmjs 版本 -- [[#6879](https://github.com/apache/incubator-seata/pull/6879)] 修复日志参数不匹配问题 -- [[#6898](https://github.com/apache/incubator-seata/pull/6898)] 升级 saga 模块 npmjs 版本 -- [[#6902](https://github.com/apache/incubator-seata/pull/6900)] 优化 readme 文档 -- [[#6807](https://github.com/apache/incubator-seata/pull/6807)] 分离merge消息使其能完全并行处理 -- [[#6905](https://github.com/apache/incubator-seata/pull/6905)] 移除构建期不兼容的 license -- [[#6906](https://github.com/apache/incubator-seata/pull/6906)] h2依赖添加test scope -- [[#6911](https://github.com/apache/incubator-seata/pull/6911)] 修正项目中的部分拼写错误 -- [[#6918](https://github.com/apache/incubator-seata/pull/6918)] 使用eclipse-temurin的openjdk镜像作为基础镜像 -- [[#6938](https://github.com/apache/incubator-seata/pull/6938)] 更新 README.md 中的社区联系信息 -- [[#6950](https://github.com/apache/incubator-seata/pull/6950)] 移除JVM参数app.id -- [[#6959](https://github.com/apache/incubator-seata/pull/6959)] 修正 `seata-http-jakarta`的模块命名和描述 -- [[#6991](https://github.com/apache/incubator-seata/pull/6991)] gRPC协议序列化默认值为protobuf -- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] 优化 AT 事务模式锁释放逻辑 -- [[#6993](https://github.com/apache/incubator-seata/pull/6993)] 优化 metrics 指标 -- [[#6995](https://github.com/apache/incubator-seata/pull/6995)] 升级过时的 npmjs 依赖 -- [[#6996](https://github.com/apache/incubator-seata/pull/6996)] 优化 AT 事务模式锁释放逻辑 -- [[#7023](https://github.com/apache/incubator-seata/pull/7023)] 优化快速失败 -- [[#7027](https://github.com/apache/incubator-seata/pull/7027)] raft模式下reload行为与file保持一致 -- [[#6891](https://github.com/apache/incubator-seata/pull/6891)] 增加 StateType 类型 +- [[#6499](https://github.com/apache/incubator-seata/pull/6499)] 拆分 committing 和 rollbacking 状态的任务线程池 +- [[#6208](https://github.com/apache/incubator-seata/pull/6208)] 支持多版本的Seata序列化 +- [[#6209](https://github.com/apache/incubator-seata/pull/6209)] 解开 RpcMessage 和 Encoder/Decoder 的互相依赖 +- [[#6634](https://github.com/apache/incubator-seata/pull/6634)] 根据协议版本指定channel handle +- [[#6523](https://github.com/apache/incubator-seata/pull/6523)] 升级 alibaba/druid 的版本到1.2.20 +- [[#6566](https://github.com/apache/incubator-seata/pull/6566)] 支持GlobalTransactionScanner类中exposeProxy属性的配置 +- [[#6534](https://github.com/apache/incubator-seata/pull/6534)] 优化: 发送异步响应 +- [[#6534](https://github.com/apache/incubator-seata/pull/6648)] 增加license header信息 +- [[#6666](https://github.com/apache/incubator-seata/pull/6666)] 添加ExceptionUtil工具类用于解包装异常 +- [[#6654](https://github.com/apache/incubator-seata/pull/6654)] 增加Namingserver打包功能 +- [[#6667](https://github.com/apache/incubator-seata/pull/6667)] 优化Namingserver日志输出 +- [[#6687](https://github.com/apache/incubator-seata/pull/6687)] 删除前端构建的静态代码 +- [[#6700](https://github.com/apache/incubator-seata/pull/6700)] 去掉sdk版本检查 +- [[#6727](https://github.com/apache/incubator-seata/pull/6727)] 反序列化性能优化 +- [[#6732](https://github.com/apache/incubator-seata/pull/6732)] 为application.example.yml与application.raft.example.yml添加默认安全配置 +- [[#6651](https://github.com/apache/incubator-seata/pull/6651)] 为 proto 文件添加 license header +- [[#6653](https://github.com/apache/incubator-seata/pull/6653)] 优化多 license和移除license url +- [[#6655](https://github.com/apache/incubator-seata/pull/6655)] 更新前端 license +- [[#6652](https://github.com/apache/incubator-seata/pull/6652)] 为spring 配置文件添加 license header +- [[#6656](https://github.com/apache/incubator-seata/pull/6656)] 更新源码中的 license +- [[#6650](https://github.com/apache/incubator-seata/pull/6650)] 为 SPI配置文件添加 license header +- [[#6741](https://github.com/apache/incubator-seata/pull/6741)] 升级 tomcat-embed-core 至 9.0.90 版本 +- [[#6742](https://github.com/apache/incubator-seata/pull/6742)] 升级 console 模块 npmjs 版本 +- [[#6732](https://github.com/apache/incubator-seata/pull/6732)] 为application.example.yml与application.raft.example.yml添加默认安全配置 +- [[#6743](https://github.com/apache/incubator-seata/pull/6743)] 升级saga模块npmjs版本 +- [[#6746](https://github.com/apache/incubator-seata/pull/6746)] 优化 compatible 模块依赖 +- [[#6745](https://github.com/apache/incubator-seata/pull/6745)] 修复 node-gyp 在 arm64 和 macos 构建失败问题 +- [[#6749](https://github.com/apache/incubator-seata/pull/6749)] 优化 WebSecurityConfig csrf 处理 +- [[#6748](https://github.com/apache/incubator-seata/pull/6748)] 优化 ConsistentHashLoadBalance 算法 +- [[#6747](https://github.com/apache/incubator-seata/pull/6747)] 优化 fastjson 反序列化 +- [[#6755](https://github.com/apache/incubator-seata/pull/6755)] 优化namingserver代码逻辑 +- [[#6763](https://github.com/apache/incubator-seata/pull/6763)] 优化 NacosConfiguration 单例加载 +- [[#6761](https://github.com/apache/incubator-seata/pull/6761)] 提升namingserver manager代码可读性 +- [[#6768](https://github.com/apache/incubator-seata/pull/6768)] 上报tcc fence事务隔离级别 +- [[#6770](https://github.com/apache/incubator-seata/pull/6770)] 通过caffeine map支持namingserver事务分组的过期删除 +- [[#6780](https://github.com/apache/incubator-seata/pull/6780)] 优化类 `SerializerServiceLoader` 中的反射操作 +- [[#6784](https://github.com/apache/incubator-seata/pull/6784)] 升级 axios 至 1.7.4 版本 +- [[#6787](https://github.com/apache/incubator-seata/pull/6787)] 升级 elliptic 至 6.5.7 版本 +- [[#6783](https://github.com/apache/incubator-seata/pull/6783)] 将server事务分组修改接口改为/vgroup/v1 +- [[#6793](https://github.com/apache/incubator-seata/pull/6793)] 修复 npmjs 依赖冲突问题 +- [[#6794](https://github.com/apache/incubator-seata/pull/6794)] 优化 NacosMockTest 单测问题 +- [[#6793](https://github.com/apache/incubator-seata/pull/6795)] 独立server的meta信息初始化逻辑 +- [[#6806](https://github.com/apache/incubator-seata/pull/6806)] 优化`tableMeta`缓存定时刷新问题 +- [[#6808](https://github.com/apache/incubator-seata/pull/6808)] 修改版本号为2.2.0-SNAPSHOT +- [[#6819](https://github.com/apache/incubator-seata/pull/6819)] namingserver与server的合并打包 +- [[#6827](https://github.com/apache/incubator-seata/pull/6827)] 重命名namingserver注册类型改为seata +- [[#6836](https://github.com/apache/incubator-seata/pull/6836)] 为CI流程增加独立nacos +- [[#6841](https://github.com/apache/incubator-seata/pull/6841)] 更新license和notice文件并统一依赖版本 +- [[#6823](https://github.com/apache/incubator-seata/pull/6823)] 修正DefaultGlobalTransaction日志的错别字 +- [[#6779](https://github.com/apache/incubator-seata/pull/6779)] 在config模块中使用curator替代zkclient +- [[#6831](https://github.com/apache/incubator-seata/pull/6831)] 在registry模块中使用curator替代zkclient +- [[#6803](https://github.com/apache/incubator-seata/pull/6803)] 优化 ARM64 架构的编译打包 +- [[#6852](https://github.com/apache/incubator-seata/pull/6852)] 优化raft接口 + ### refactor: -- [[#7017](https://github.com/apache/incubator-seata/pull/7017)] 移除 seata-server 模块的依赖 +### security: +- [[#6702](https://github.com/apache/incubator-seata/pull/6702)] 修复Raft反序列化时存在RCE安全漏洞 + ### test: -- [[#6869](https://github.com/apache/incubator-seata/pull/6869)] 增加`seata-core`测试用例覆盖率 -- [[#6927](https://github.com/apache/incubator-seata/pull/6927)] 增加`seata-rocketmq`模块的测试用例 -- [[#7018](https://github.com/apache/incubator-seata/pull/7018)] 增加 `seata-tm` 模块的测试用例 -- [[#7030](https://github.com/apache/incubator-seata/pull/7030)] 增加 `seata-common` 模块的测试用例 +- [[#6533](https://github.com/apache/incubator-seata/pull/6533)] 增加 Integration-TX-API 模块单元测试覆盖范围 +- [[#6608](https://github.com/apache/incubator-seata/pull/6608)] 添加sql-parser-core模块测试用例 +- [[#6647](https://github.com/apache/incubator-seata/pull/6647)] 增加saga模块的测试用例覆盖率 +- [[#6695](https://github.com/apache/incubator-seata/pull/6695)] 多版本协议的旧版本(< 0.7.1)客户端测试用例 +- [[#6752](https://github.com/apache/incubator-seata/pull/6752)] 增加metrics模块测试用例覆盖率 +- [[#6764](https://github.com/apache/incubator-seata/pull/6764)] 增加 Apollo Mock 测试用例 +- [[#6750](https://github.com/apache/incubator-seata/pull/6750)] 提升spring autoconfigure模块单测覆盖率 +- [[#6773](https://github.com/apache/incubator-seata/pull/6773)] 修复codecov图标显示错误的代码覆盖率 +- [[#6821](https://github.com/apache/incubator-seata/pull/6821)] 修复单元测试断言 非常感谢以下 contributors 的代码贡献。若有无意遗漏,请报告。 - [slievrly](https://github.com/slievrly) -- [GoodBoyCoder](https://github.com/GoodBoyCoder) +- [tuwenlin](https://github.com/tuwenlin) +- [YeonCheolGit](https://github.com/YeonCheolGit) +- [liuqiufeng](https://github.com/liuqiufeng) +- [God-Gan](https://github.com/God-Gan) +- [Bughue](https://github.com/Bughue) - [funky-eyes](https://github.com/funky-eyes) -- [dk2k](https://github.com/dk2k) -- [MaoMaoandSnail](https://github.com/MaoMaoandSnail) -- [yougecn](https://github.com/yougecn) -- [arrrnold17](https://github.com/arrrnold17) +- [tanyaofei](https://github.com/tanyaofei) +- [traitsisgiorgos](https://github.com/traitsisgiorgos) +- [wanghongzhou](https://github.com/wanghongzhou) +- [ggbocoder](https://github.com/ggbocoder) +- [azatyamanaev](https://github.com/azatyamanaev) - [xjlgod](https://github.com/xjlgod) -- [PleaseGiveMeTheCoke](https://github.com/PleaseGiveMeTheCoke) -- [dsomehan](https://github.com/dsomehan) -- [psxjoy](https://github.com/psxjoy) - [xingfudeshi](https://github.com/xingfudeshi) -- [o-jimin](https://github.com/o-jimin) -- [lixingjia77](https://github.com/lixingjia77) -- [whaon](https://github.com/whaon) -- [YvCeung](https://github.com/YvCeung) +- [wuwen5](https://github.com/wuwen5) - [jsbxyyx](https://github.com/jsbxyyx) +- [iAmClever](https://github.com/iAmClever) +- [GoodBoyCoder](https://github.com/GoodBoyCoder) +- [liuqiufeng](https://github.com/liuqiufeng) +- [caohdgege](https://github.com/caohdgege) +- [TakeActionNow2019](https://github.com/TakeActionNow2019) +- [imashimaro](https://github.com/hmj776521114) +- [lyl2008dsg](https://github.com/lyl2008dsg) - [lightClouds917](https://github.com/lightClouds917) -- [Muluo-cyan](https://github.com/Muluo-cyan) -- [MaoMaoandSnail](https://github.com/MaoMaoandSnail) +- [l81893521](https://github.com/l81893521) +- [laywin](https://github.com/laywin) +- [xiaoxiangyeyu0](https://github.com/xiaoxiangyeyu0) +- [LegGasai](https://github.com/LegGasai) +- [yangli-stu](https://github.com/yangli-stu) +- [heliang666s](https://github.com/heliang666s) + 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。 From 4d7efe49bfb592d2dea3b6cef0757d135474cc1a Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 16:43:07 +0800 Subject: [PATCH 2/7] fix datasourece tablemeta refresh after closed --- .../sql/struct/TableMetaCacheFactory.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java index b0048b32596..2e28ea3a2af 100644 --- a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java +++ b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java @@ -17,6 +17,7 @@ package org.apache.seata.rm.datasource.sql.struct; import java.sql.Connection; +import java.sql.SQLException; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; @@ -99,6 +100,14 @@ public static void tableMetaRefreshEvent(String resourceId) { } } + /** + * Remove the TableMetaRefreshHolder from the map. + */ + private static void removeHolderFromMap(String resourceId) { + TABLE_META_REFRESH_HOLDER_MAP.remove(resourceId); + LOGGER.info("Removed TableMetaRefreshHolder for resourceId: {}", resourceId); + } + static class TableMetaRefreshHolder { private long lastRefreshFinishTime; private DataSourceProxy dataSource; @@ -133,6 +142,14 @@ static class TableMetaRefreshHolder { } lastRefreshFinishTime = System.nanoTime(); } + }catch (SQLException ex) { + if (isDataSourceClosedException(ex)) { + LOGGER.info("DataSource is closed, exiting refresh task for resourceId: {}", dataSource.getResourceId()); + removeHolderFromMap(dataSource.getResourceId()); + return; + } else { + LOGGER.error("Table refresh SQL error: {}", ex.getMessage(), ex); + } } catch (Exception exx) { LOGGER.error("table refresh error:{}", exx.getMessage(), exx); // Avoid high CPU usage due to infinite loops caused by database exceptions @@ -142,6 +159,17 @@ static class TableMetaRefreshHolder { }); } + /** + * Helper method to determine if the exception is caused by the data source being closed. + * + * @param ex the SQLException to check + * @return true if the exception indicates the data source is closed; false otherwise + */ + private boolean isDataSourceClosedException(SQLException ex) { + String message = ex.getMessage(); + return message != null && message.contains("closed"); + } + } From fe15be566c65a5216cd61163baf8b8a092bd2a5b Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 16:45:26 +0800 Subject: [PATCH 3/7] code style --- .../seata/rm/datasource/sql/struct/TableMetaCacheFactory.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java index 2e28ea3a2af..1e20b0f75f3 100644 --- a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java +++ b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java @@ -169,8 +169,5 @@ private boolean isDataSourceClosedException(SQLException ex) { String message = ex.getMessage(); return message != null && message.contains("closed"); } - - - } } From f959bd4ff2a81678b89c0a4147ead92b77ca7891 Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 16:49:22 +0800 Subject: [PATCH 4/7] change.md --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + 2 files changed, 2 insertions(+) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index e72c9c481a6..789242cb85d 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -30,6 +30,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#7010](https://github.com/apache/incubator-seata/pull/7010)] fix error while the "context" is key word in DM8 when delete undolog - [[#7022](https://github.com/apache/incubator-seata/pull/7022)] fix `store.mode` property in `application.raft.example.yml` - [[#7025](https://github.com/apache/incubator-seata/pull/7025)] fix vGroupMappingManager is NOT init +- [[#7044](https://github.com/apache/incubator-seata/pull/7044)] fix tableMeta refresh after closed - ### optimize: - [[#6826](https://github.com/apache/incubator-seata/pull/6826)] remove the branch registration operation of the XA read-only transaction diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 25cb1cd7fe1..abaa8d4fd93 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -30,6 +30,7 @@ - [[#7010](https://github.com/apache/incubator-seata/pull/7010)] 修复使用达梦数据库时删除undolog发生SQL语法错误 - [[#7022](https://github.com/apache/incubator-seata/pull/7022)] 修复 `application.raft.example.yml`的 `store.mode`属性 - [[#7025](https://github.com/apache/incubator-seata/pull/7025)] 修复vGroupMappingManager未初始化的问题 +- [[#7044](https://github.com/apache/incubator-seata/pull/7044)] 修复TableMeta在数据源关闭后刷新错误问题 ### optimize: - [[#6826](https://github.com/apache/incubator-seata/pull/6826)] 移除只读XA事务的分支注册操作 From d2b4dd0d249d74e084787e9a66df2cab1b7d7d0c Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 16:53:05 +0800 Subject: [PATCH 5/7] fix --- .../seata/rm/datasource/sql/struct/TableMetaCacheFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java index 1e20b0f75f3..12d25f6efe2 100644 --- a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java +++ b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java @@ -148,7 +148,9 @@ static class TableMetaRefreshHolder { removeHolderFromMap(dataSource.getResourceId()); return; } else { + // other error, avoid high CPU usage due to infinite loops caused by database exceptions LOGGER.error("Table refresh SQL error: {}", ex.getMessage(), ex); + lastRefreshFinishTime = System.nanoTime(); } } catch (Exception exx) { LOGGER.error("table refresh error:{}", exx.getMessage(), exx); From 23fd5a091b8fc1a08a9bdf35037bf37e0e032a95 Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 16:54:41 +0800 Subject: [PATCH 6/7] code style --- .../seata/rm/datasource/sql/struct/TableMetaCacheFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java index 12d25f6efe2..81c4a0d0052 100644 --- a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java +++ b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java @@ -142,7 +142,7 @@ static class TableMetaRefreshHolder { } lastRefreshFinishTime = System.nanoTime(); } - }catch (SQLException ex) { + } catch (SQLException ex) { if (isDataSourceClosedException(ex)) { LOGGER.info("DataSource is closed, exiting refresh task for resourceId: {}", dataSource.getResourceId()); removeHolderFromMap(dataSource.getResourceId()); From 4ba8f98ae32d10969d0dc6af7e57c9777b68a9b1 Mon Sep 17 00:00:00 2001 From: leggasai <1642271413@qq.com> Date: Tue, 3 Dec 2024 23:17:14 +0800 Subject: [PATCH 7/7] fix datasource close --- .../datasource/sql/struct/TableMetaCacheFactory.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java index 81c4a0d0052..c956796ea12 100644 --- a/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java +++ b/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/TableMetaCacheFactory.java @@ -30,6 +30,7 @@ import org.apache.seata.common.loader.EnhancedServiceLoader; import org.apache.seata.common.thread.NamedThreadFactory; import org.apache.seata.common.util.CollectionUtils; +import org.apache.seata.common.util.StringUtils; import org.apache.seata.config.ConfigurationFactory; import org.apache.seata.rm.datasource.DataSourceProxy; import org.apache.seata.sqlparser.struct.TableMetaCache; @@ -168,8 +169,13 @@ static class TableMetaRefreshHolder { * @return true if the exception indicates the data source is closed; false otherwise */ private boolean isDataSourceClosedException(SQLException ex) { - String message = ex.getMessage(); - return message != null && message.contains("closed"); + String message = ex.getMessage().toLowerCase(); + String sqlState = ex.getSQLState(); + // Most jdbc drivers use '08006' as the datasource close code. + if ("08006".equals(sqlState)) { + return true; + } + return StringUtils.isNotBlank(message) && message.contains("datasource") && message.contains("close"); } } }