From 379bbed0ee363bfc9f31e4591f5d46c28976cff5 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Fri, 29 Apr 2022 17:21:55 +0600 Subject: [PATCH] Fix: return of CLUSTER REPLICAS is Array reply (#2990) not Bulk reply as it as has been stated in the [Redis doc](https://redis.io/commands/cluster-replicas/) --- src/main/java/redis/clients/jedis/Jedis.java | 14 +++++++------- .../clients/jedis/commands/ClusterCommands.java | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java index 09cb0713f4..2128861c68 100644 --- a/src/main/java/redis/clients/jedis/Jedis.java +++ b/src/main/java/redis/clients/jedis/Jedis.java @@ -8581,13 +8581,6 @@ public String clusterNodes() { return connection.getBulkReply(); } - @Override - public String clusterReplicas(final String nodeId) { - checkIsInMultiOrPipeline(); - connection.sendCommand(CLUSTER, ClusterKeyword.REPLICAS.name(), nodeId); - return connection.getBulkReply(); - } - @Override public String clusterMeet(final String ip, final int port) { checkIsInMultiOrPipeline(); @@ -8743,6 +8736,13 @@ public List clusterSlaves(final String nodeId) { return connection.getMultiBulkReply(); } + @Override + public List clusterReplicas(final String nodeId) { + checkIsInMultiOrPipeline(); + connection.sendCommand(CLUSTER, ClusterKeyword.REPLICAS.name(), nodeId); + return connection.getMultiBulkReply(); + } + @Override public String clusterFailover() { checkIsInMultiOrPipeline(); diff --git a/src/main/java/redis/clients/jedis/commands/ClusterCommands.java b/src/main/java/redis/clients/jedis/commands/ClusterCommands.java index 7c300d61d1..8fdf5d7335 100644 --- a/src/main/java/redis/clients/jedis/commands/ClusterCommands.java +++ b/src/main/java/redis/clients/jedis/commands/ClusterCommands.java @@ -16,8 +16,6 @@ public interface ClusterCommands { String clusterNodes(); - String clusterReplicas(String nodeId); - String clusterMeet(String ip, int port); String clusterAddSlots(int... slots); @@ -75,6 +73,8 @@ public interface ClusterCommands { @Deprecated List clusterSlaves(String nodeId); + List clusterReplicas(String nodeId); + String clusterFailover(); String clusterFailover(ClusterFailoverOption failoverOption);