diff --git a/changes/en-us/develop.md b/changes/en-us/develop.md
index 881a4ad5ce9..4716fa2dddf 100644
--- a/changes/en-us/develop.md
+++ b/changes/en-us/develop.md
@@ -9,7 +9,7 @@ Add changes here for all PR submitted to the develop branch.
### bugfix:
- [[#5833](https://github.com/seata/seata/pull/5833)] bugfix: fix TC retry rollback wrongly, after the XA transaction fail and rollback
- [[#5884](https://github.com/seata/seata/pull/5884)] fix dm escaped characters for upper and lower case column names
-
+- [[#5931](https://github.com/seata/seata/pull/5931)] fix the issue of missing sentinel password in store redis mode
### optimize:
- [[#5866](https://github.com/seata/seata/pull/5866)] some minor syntax optimization
- [[#5889](https://github.com/seata/seata/pull/5889)] remove dependency without license
diff --git a/changes/zh-cn/develop.md b/changes/zh-cn/develop.md
index 9486a0b093d..218dfa97348 100644
--- a/changes/zh-cn/develop.md
+++ b/changes/zh-cn/develop.md
@@ -9,6 +9,7 @@
### bugfix:
- [[#5833](https://github.com/seata/seata/pull/5833)] bugfix: 修复当 XA 事务失败回滚后,TC 还会继续重试回滚的问题
- [[#5884](https://github.com/seata/seata/pull/5884)] 修复达梦前后镜像查询列名都加了引号导致sql异常的问题
+- [[#5931](https://github.com/seata/seata/pull/5931)] 修复存储redis哨兵模式下哨兵密码缺失的问题
### optimize:
- [[#5866](https://github.com/seata/seata/pull/5866)] 一些小的语法优化
diff --git a/common/src/main/java/io/seata/common/ConfigurationKeys.java b/common/src/main/java/io/seata/common/ConfigurationKeys.java
index 037ac246f4b..8a584b2b8b9 100644
--- a/common/src/main/java/io/seata/common/ConfigurationKeys.java
+++ b/common/src/main/java/io/seata/common/ConfigurationKeys.java
@@ -738,6 +738,11 @@ public interface ConfigurationKeys {
*/
String STORE_REDIS_SENTINEL_HOST = STORE_REDIS_SENTINEL_PREFIX + "sentinelHosts";
+ /**
+ * STORE_REDIS_SENTINEL_PASSWORD.
+ */
+ String STORE_REDIS_SENTINEL_PASSWORD = STORE_REDIS_SENTINEL_PREFIX + "sentinelPassword";
+
/**
* The constant CLIENT_DEGRADE_CHECK_PERIOD.
*/
diff --git a/dependencies/pom.xml b/dependencies/pom.xml
index e33cf878db9..6b608560920 100644
--- a/dependencies/pom.xml
+++ b/dependencies/pom.xml
@@ -92,7 +92,7 @@
0.2.0-RC2
- 3.2.0
+ 3.8.0
diff --git a/script/config-center/config.txt b/script/config-center/config.txt
index 8e7065e8ef7..38f49bff14a 100644
--- a/script/config-center/config.txt
+++ b/script/config-center/config.txt
@@ -102,6 +102,7 @@ store.redis.single.host=127.0.0.1
store.redis.single.port=6379
store.redis.sentinel.masterName=
store.redis.sentinel.sentinelHosts=
+store.redis.sentinel.sentinelPassword=
store.redis.maxConn=10
store.redis.minConn=1
store.redis.maxTotal=100
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 c6420d84db7..d42a31609ac 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
@@ -142,6 +142,8 @@ public static class Sentinel {
*/
private String sentinelHosts;
+ private String sentinelPassword;
+
public String getMasterName() {
return masterName;
}
@@ -159,5 +161,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 d3d1a442eed..8512145c1d8 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,11 +27,12 @@
import io.seata.core.constants.ConfigurationKeys;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import redis.clients.jedis.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;
@@ -59,7 +60,7 @@ public class JedisPooledFactory {
/**
* get the RedisPool instance (singleton)
- *
+ *
* @return redisPool
*/
public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisPools) {
@@ -98,7 +99,8 @@ public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisP
Set sentinels = new HashSet<>(SENTINEL_HOST_NUMBER);
String[] sentinelHosts = CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SENTINEL_HOST).split(",");
Arrays.asList(sentinelHosts).forEach(sentinelHost -> sentinels.add(sentinelHost));
- tempJedisPool = new JedisSentinelPool(masterName, sentinels, poolConfig, 60000, password, CONFIGURATION.getInt(ConfigurationKeys.STORE_REDIS_DATABASE, DATABASE));
+ tempJedisPool = new JedisSentinelPool(masterName, sentinels, poolConfig, 60000, 60000, password, CONFIGURATION.getInt(ConfigurationKeys.STORE_REDIS_DATABASE, DATABASE),
+ null, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SENTINEL_PASSWORD), null);
} else if (mode.equals(ConfigurationKeys.REDIS_SINGLE_MODE)) {
String host = CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_SINGLE_HOST);
host = StringUtils.isBlank(host) ? CONFIGURATION.getConfig(ConfigurationKeys.STORE_REDIS_HOST, HOST) : host;
@@ -121,7 +123,7 @@ public static JedisPoolAbstract getJedisPoolInstance(JedisPoolAbstract... jedisP
/**
* get an instance of Jedis (connection) from the connection pool
- *
+ *
* @return jedis
*/
public static Jedis getJedisInstance() {
diff --git a/server/src/main/resources/application.example.yml b/server/src/main/resources/application.example.yml
index 211c95c5e70..30679032ddb 100644
--- a/server/src/main/resources/application.example.yml
+++ b/server/src/main/resources/application.example.yml
@@ -179,6 +179,7 @@ seata:
sentinel:
master-name:
sentinel-hosts:
+ sentinel-password:
metrics:
enabled: false
registry-type: compact