From 9878a1da9a08a4ef548b20dfa134d1a412c70d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BE=B7=E8=93=89?= Date: Tue, 17 Oct 2023 10:37:21 +0800 Subject: [PATCH] bugfix --- changes/en-us/2.0.0.md | 2 +- .../properties/server/store/StoreRedisProperties.java | 11 +++++++++++ .../server/storage/redis/JedisPooledFactory.java | 8 ++++++-- server/src/main/resources/application.example.yml | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/changes/en-us/2.0.0.md b/changes/en-us/2.0.0.md index 67ae63ca40b..88d5c45bc94 100644 --- a/changes/en-us/2.0.0.md +++ b/changes/en-us/2.0.0.md @@ -75,7 +75,7 @@ The version is updated as follows: - [[#5821](https://github.com/seata/seata/pull/5821)] fix insert executor keywords unescape - [[#5835](https://github.com/seata/seata/pull/5835)] bugfix: fix TC retry rollback wrongly, after the XA transaction fail and rollback - [[#5881](https://github.com/seata/seata/pull/5880)] fix delete branch table unlock failed -- [[#5930](https://github.com/seata/seata/pull/5930)] fix the problem of missing sentinel password in store redis mode +- [[#5930](https://github.com/seata/seata/pull/5930)] fix the issue of missing sentinel password in store redis mode ### optimizeļ¼š - [[#5208](https://github.com/seata/seata/pull/5208)] optimize throwable getCause once more diff --git a/seata-spring-autoconfigure/seata-spring-autoconfigure-server/src/main/java/io/seata/spring/boot/autoconfigure/properties/server/store/StoreRedisProperties.java b/seata-spring-autoconfigure/seata-spring-autoconfigure-server/src/main/java/io/seata/spring/boot/autoconfigure/properties/server/store/StoreRedisProperties.java index 54f93887cf0..13090e8c178 100644 --- a/seata-spring-autoconfigure/seata-spring-autoconfigure-server/src/main/java/io/seata/spring/boot/autoconfigure/properties/server/store/StoreRedisProperties.java +++ b/seata-spring-autoconfigure/seata-spring-autoconfigure-server/src/main/java/io/seata/spring/boot/autoconfigure/properties/server/store/StoreRedisProperties.java @@ -149,6 +149,8 @@ public static class Sentinel { */ private String sentinelHosts; + private String sentinelPassword; + public String getMasterName() { return masterName; } @@ -166,5 +168,14 @@ public Sentinel setSentinelHosts(String sentinelHosts) { this.sentinelHosts = sentinelHosts; return this; } + + public String getSentinelPassword() { + return sentinelPassword; + } + + public Sentinel setSentinelPassword(String sentinelPassword) { + this.sentinelPassword = sentinelPassword; + return this; + } } } diff --git a/server/src/main/java/io/seata/server/storage/redis/JedisPooledFactory.java b/server/src/main/java/io/seata/server/storage/redis/JedisPooledFactory.java index 45fc28e336f..6a506df9116 100644 --- a/server/src/main/java/io/seata/server/storage/redis/JedisPooledFactory.java +++ b/server/src/main/java/io/seata/server/storage/redis/JedisPooledFactory.java @@ -27,8 +27,12 @@ import io.seata.core.constants.ConfigurationKeys; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import redis.clients.jedis.*; - +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.JedisPoolAbstract; +import redis.clients.jedis.JedisPoolConfig; +import redis.clients.jedis.JedisSentinelPool; +import redis.clients.jedis.Protocol; +import redis.clients.jedis.Jedis; import static io.seata.common.DefaultValues.DEFAULT_REDIS_MAX_IDLE; import static io.seata.common.DefaultValues.DEFAULT_REDIS_MAX_TOTAL; import static io.seata.common.DefaultValues.DEFAULT_REDIS_MIN_IDLE; diff --git a/server/src/main/resources/application.example.yml b/server/src/main/resources/application.example.yml index 459ebd411c6..08705e7a0bd 100644 --- a/server/src/main/resources/application.example.yml +++ b/server/src/main/resources/application.example.yml @@ -182,6 +182,7 @@ seata: sentinel: master-name: sentinel-hosts: + sentinel-password: metrics: enabled: false registry-type: compact