|
|
|
@ -847,7 +847,7 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
|
|
|
|
|
CompletableFuture<List<RedisURI>> ipsFuture = serviceManager.resolveAll(clusterNodeInfo.getAddress());
|
|
|
|
|
CompletableFuture<Void> f = ipsFuture.thenAccept(addresses -> {
|
|
|
|
|
if (addresses.size() > 1 && clusterNodeInfo.containsFlag(Flag.MASTER)) {
|
|
|
|
|
addresses.sort(null);
|
|
|
|
|
addresses.sort(Comparator.comparing(RedisURI::getHost));
|
|
|
|
|
Collections.shuffle(addresses, new Random(serviceManager.getId().hashCode()));
|
|
|
|
|
}
|
|
|
|
|
RedisURI address = addresses.get(0);
|
|
|
|
|