Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix the exception in RedisTransactionStoreManager #4682

Merged
merged 4 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
3 changes: 3 additions & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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线程池的线程数
Expand All @@ -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和建议,非常感谢大家。
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -664,7 +665,7 @@ public List<GlobalSession> findGlobalSessionByPage(int pageNum, int pageSize, bo
* @return
*/
private Map<String, Integer> calculateStatuskeysHasData(List<String> statusKeys) {
Map<String, Integer> resultMap = Collections.synchronizedMap(new LinkedHashMap<>());
Map<String, Integer> resultMap = new LinkedHashMap<>();
Map<String, Integer> keysMap = new HashMap<>(statusKeys.size());
try (Jedis jedis = JedisPooledFactory.getJedisInstance(); Pipeline pipelined = jedis.pipelined()) {
statusKeys.forEach(key -> pipelined.llen(key));
Expand Down Expand Up @@ -732,7 +733,9 @@ private void dogetXidsForTargetMapRecursive(Map<String, Integer> targetMap, long
}

try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
for (String key : targetMap.keySet()) {
Iterator<Map.Entry<String, Integer>> 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) {
Expand All @@ -746,11 +749,11 @@ private void dogetXidsForTargetMapRecursive(Map<String, Integer> targetMap, long
list = jedis.lrange(key, start, end);
}

if (list.size() > 0 && sum < queryCount) {
if (list.size() > 0) {
listList.add(list);
slievrly marked this conversation as resolved.
Show resolved Hide resolved
} else {
if (list.size() == 0) {
targetMap.remove(key);
iterator.remove();
slievrly marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down