diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md index 80f67efc197..426aadae75d 100644 --- a/changes/en-us/develop.md +++ b/changes/en-us/develop.md @@ -9,8 +9,10 @@ Add changes here for all PR submitted to the develop branch. ### bugfix: - [[#4515](https://github.com/seata/seata/pull/4515)] fix the error of SeataTCCFenceAutoConfiguration when database unused - [[#4661](https://github.com/seata/seata/pull/4661)] fix sql exception with PostgreSQL in module console + - [[#4667](https://github.com/seata/seata/pull/4682)] fix the exception in RedisTransactionStoreManager for update map During iteration - [[#4678](https://github.com/seata/seata/pull/4678)] fix the error of key transport.enableRmClientBatchSendRequest cache penetration if not configure + ### optimize: - [[#4650](https://github.com/seata/seata/pull/4650)] fix some security vulnerabilities - [[#4670](https://github.com/seata/seata/pull/4670)] optimize the thread pool size of branchResultMessageExecutor @@ -25,5 +27,6 @@ Thanks to these contributors for their code commits. Please report an unintended - [YSF-A](https://github.com/YSF-A) - [tuwenlin](https://github.com/tuwenlin) - [Ifdevil](https://github.com/Ifdevil) +- [wingchi-leung](https://github.com/wingchi-leung) Also, we receive many valuable issues, questions and advices from our community. Thanks for you all. diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md index c35e36020a9..e225445e261 100644 --- a/changes/zh-cn/develop.md +++ b/changes/zh-cn/develop.md @@ -7,8 +7,10 @@ ### bugfix: - [[#4515](https://github.com/seata/seata/pull/4515)] 修复develop分支SeataTCCFenceAutoConfiguration在客户端未使用DB时,启动抛出ClassNotFoundException的问题。 - [[#4661](https://github.com/seata/seata/pull/4661)] 修复控制台中使用PostgreSQL出现的SQL异常 + - [[#4667](https://github.com/seata/seata/pull/4682)] 修复develop分支RedisTransactionStoreManager迭代时更新map的异常 - [[#4678](https://github.com/seata/seata/pull/4678)] 修复属性transport.enableRmClientBatchSendRequest没有配置的情况下缓存穿透的问题 + ### optimize: - [[#4650](https://github.com/seata/seata/pull/4650)] 修复安全漏洞 - [[#4670](https://github.com/seata/seata/pull/4670)] 优化branchResultMessageExecutor线程池的线程数 @@ -23,5 +25,6 @@ - [YSF-A](https://github.com/YSF-A) - [tuwenlin](https://github.com/tuwenlin) - [Ifdevil](https://github.com/Ifdevil) +- [wingchi-leung](https://github.com/wingchi-leung) 同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。 \ No newline at end of file diff --git a/server/src/main/java/io/seata/server/storage/redis/store/RedisTransactionStoreManager.java b/server/src/main/java/io/seata/server/storage/redis/store/RedisTransactionStoreManager.java index b8a23bd3985..02d504fd697 100644 --- a/server/src/main/java/io/seata/server/storage/redis/store/RedisTransactionStoreManager.java +++ b/server/src/main/java/io/seata/server/storage/redis/store/RedisTransactionStoreManager.java @@ -15,6 +15,7 @@ */ package io.seata.server.storage.redis.store; +import java.util.Iterator; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -664,7 +665,7 @@ public List findGlobalSessionByPage(int pageNum, int pageSize, bo * @return */ private Map calculateStatuskeysHasData(List statusKeys) { - Map resultMap = Collections.synchronizedMap(new LinkedHashMap<>()); + Map resultMap = new LinkedHashMap<>(); Map keysMap = new HashMap<>(statusKeys.size()); try (Jedis jedis = JedisPooledFactory.getJedisInstance(); Pipeline pipelined = jedis.pipelined()) { statusKeys.forEach(key -> pipelined.llen(key)); @@ -732,7 +733,9 @@ private void dogetXidsForTargetMapRecursive(Map targetMap, long } try (Jedis jedis = JedisPooledFactory.getJedisInstance()) { - for (String key : targetMap.keySet()) { + Iterator> iterator = targetMap.entrySet().iterator(); + while (iterator.hasNext()) { + String key = iterator.next().getKey(); final long sum = listList.stream().mapToLong(List::size).sum(); final long diffCount = queryCount - sum; if (diffCount <= 0) { @@ -746,11 +749,11 @@ private void dogetXidsForTargetMapRecursive(Map targetMap, long list = jedis.lrange(key, start, end); } - if (list.size() > 0 && sum < queryCount) { + if (list.size() > 0) { listList.add(list); } else { if (list.size() == 0) { - targetMap.remove(key); + iterator.remove(); } } }