From 43a70f2e9f6f67526222f18589c67c7343ec21f2 Mon Sep 17 00:00:00 2001 From: j00356287 Date: Fri, 18 Oct 2024 17:36:50 +0800 Subject: [PATCH] Should not update Known nodes when refreshed topology is empty Closes #3017 --- .../java/io/lettuce/core/masterreplica/SentinelConnector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/lettuce/core/masterreplica/SentinelConnector.java b/src/main/java/io/lettuce/core/masterreplica/SentinelConnector.java index ba44025af9..146cbb55c5 100644 --- a/src/main/java/io/lettuce/core/masterreplica/SentinelConnector.java +++ b/src/main/java/io/lettuce/core/masterreplica/SentinelConnector.java @@ -120,7 +120,8 @@ private Runnable getTopologyRefreshRunnable(MasterReplicaTopologyRefresh refresh EventRecorder.getInstance().record(new MasterReplicaTopologyChangedEvent(redisURI, nodes)); if (nodes.isEmpty()) { - LOG.warn("Topology refresh returned no nodes from {}", redisURI); + LOG.warn("Topology refresh returned no nodes from {}, skip refresh Known nodes", redisURI); + return; } LOG.debug("New topology: {}", nodes);