From e35d4d96861f809daa099038509dfd7234618b62 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Thu, 27 Aug 2020 10:32:10 +0300 Subject: [PATCH] refactoring --- .../main/java/org/redisson/connection/DNSMonitor.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/redisson/src/main/java/org/redisson/connection/DNSMonitor.java b/redisson/src/main/java/org/redisson/connection/DNSMonitor.java index e9f4d9734..8e85f3d76 100644 --- a/redisson/src/main/java/org/redisson/connection/DNSMonitor.java +++ b/redisson/src/main/java/org/redisson/connection/DNSMonitor.java @@ -119,14 +119,12 @@ public class DNSMonitor { InetSocketAddress newMasterAddr = future.getNow(); if (!newMasterAddr.getAddress().equals(currentMasterAddr.getAddress())) { log.info("Detected DNS change. Master {} has changed ip from {} to {}", - entry.getKey(), currentMasterAddr.getAddress().getHostAddress(), newMasterAddr.getAddress().getHostAddress()); + entry.getKey(), currentMasterAddr.getAddress().getHostAddress(), + newMasterAddr.getAddress().getHostAddress()); + MasterSlaveEntry masterSlaveEntry = connectionManager.getEntry(currentMasterAddr); if (masterSlaveEntry == null) { - if (connectionManager instanceof SingleConnectionManager) { - log.error("Unable to find master entry for {}. Switch Redisson configuration to proxy mode to use multiple IPs resolved by Redis hostname. More details: https://github.com/redisson/redisson/wiki/2.-Configuration#29-proxy-mode", currentMasterAddr); - } else { - log.error("Unable to find master entry for {}", currentMasterAddr); - } + log.error("Unable to find entry for current master {}", currentMasterAddr); return; } masterSlaveEntry.changeMaster(newMasterAddr, entry.getKey());