diff --git a/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java b/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java index 64afaecb3..38d420864 100644 --- a/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java +++ b/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java @@ -346,6 +346,8 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager { for (Integer slot : partition.getSlots()) { addEntry(slot, entry); lastPartitions.put(slot, partition); + } + if (partition.getSlotsAmount() > 0) { lastUri2Partition.put(partition.getMasterAddress(), partition); } @@ -731,10 +733,10 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager { addedSlots.stream().forEach(slot -> { addEntry(slot, entry); lastPartitions.put(slot, currentPartition); - lastUri2Partition.put(currentPartition.getMasterAddress(), currentPartition); changedSlots.add(slot); }); if (!addedSlots.isEmpty()) { + lastUri2Partition.put(currentPartition.getMasterAddress(), currentPartition); log.info("{} slots added to {}", addedSlots.cardinality(), currentPartition.getMasterAddress()); }