Skip to content

Commit

Permalink
bugfix: cluster cannot be customized when redis serves as the registry (
Browse files Browse the repository at this point in the history
  • Loading branch information
PoppysHammer committed Aug 25, 2023
1 parent 5b920e8 commit 1770ac4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/en-us/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The version is updated as follows:
- [[#5748](https://github.com/seata/seata/pull/5748)] case of the pk col-name in the business sql is inconsistent with the case in the table metadata, resulting in a rollback failure
- [[#5745](https://github.com/seata/seata/pull/5745)] fix the problem that the parameter prefix requirement of the setAttachment method in sofa-rpc is not met
- [[#5772](https://github.com/seata/seata/pull/5762)] change some fields type of TableMetaCache to avoid integer overflow
- [[#5787](https://github.com/seata/seata/pull/5794)] Solution cluster cannot be customized when redis serves as the registry

### optimize:
- [[#5208](https://github.com/seata/seata/pull/5208)] optimize throwable getCause once more
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#5748](https://github.com/seata/seata/pull/5748)] 修复在某些情况下,业务sql中主键字段名大小写与表元数据中的不一致,导致回滚失败
- [[#5745](https://github.com/seata/seata/pull/5745)] 修复不满足 sofa-rpc 中 setAttachment 方法的参数前缀要求问题
- [[#5772](https://github.com/seata/seata/pull/5762)] 修复TableMetaCache的一些字段类型,避免溢出
- [[#5787](https://github.com/seata/seata/pull/5794)] 解决redis作为注册中心时cluster无法自定义的BUG

### optimize:
- [[#5208](https://github.com/seata/seata/pull/5208)] 优化多次重复获取Throwable#getCause问题
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void subscribe(String cluster, RedisListener listener) {
try {
try (Jedis jedis = jedisPool.getResource()) {
// try update Map every 2s
updateClusterAddressMap(jedis, redisRegistryKey);
updateClusterAddressMap(jedis, redisRegistryKey, cluster);
}
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
Expand Down Expand Up @@ -232,7 +232,7 @@ List<InetSocketAddress> lookupByCluster(String clusterName) {
if (!LISTENER_SERVICE_MAP.containsKey(clusterName)) {
String redisRegistryKey = REDIS_FILEKEY_PREFIX + clusterName;
try (Jedis jedis = jedisPool.getResource()) {
updateClusterAddressMap(jedis, redisRegistryKey);
updateClusterAddressMap(jedis, redisRegistryKey, clusterName);
}
subscribe(clusterName, msg -> {
String[] msgr = msg.split("-");
Expand Down Expand Up @@ -286,7 +286,7 @@ public void onMessage(String key, String msg) {
}
}

private void updateClusterAddressMap(Jedis jedis, String redisRegistryKey) {
private void updateClusterAddressMap(Jedis jedis, String redisRegistryKey, String clusterName) {
ScanParams scanParams = new ScanParams();
scanParams.count(10);
scanParams.match(redisRegistryKey + "_*");
Expand Down

0 comments on commit 1770ac4

Please sign in to comment.