From 409663124372253e0ffce557907586900a45e504 Mon Sep 17 00:00:00 2001 From: dlandiak Date: Thu, 28 Nov 2024 15:36:05 +0200 Subject: [PATCH] minor improvements to logging for JedisClusterTopologyRefresher --- .../broker/cache/JedisClusterTopologyRefresher.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/cache/src/main/java/org/thingsboard/mqtt/broker/cache/JedisClusterTopologyRefresher.java b/common/cache/src/main/java/org/thingsboard/mqtt/broker/cache/JedisClusterTopologyRefresher.java index 6a0bea749..fda242c67 100644 --- a/common/cache/src/main/java/org/thingsboard/mqtt/broker/cache/JedisClusterTopologyRefresher.java +++ b/common/cache/src/main/java/org/thingsboard/mqtt/broker/cache/JedisClusterTopologyRefresher.java @@ -47,10 +47,11 @@ public void refreshTopology() { log.trace("Redis cluster configuration is not set!"); return; } + log.trace("Redis cluster refresh topology is starting!"); try { RedisClusterConfiguration clusterConfig = factory.getClusterConfiguration(); Set currentNodes = clusterConfig.getClusterNodes(); - log.trace("Current Redis cluster nodes: {}", currentNodes); + log.debug("Current Redis cluster nodes: {}", currentNodes); for (RedisNode node : currentNodes) { if (!node.hasValidHost()) { @@ -67,19 +68,20 @@ public void refreshTopology() { } Set redisNodes = getRedisNodes(node, jedis); if (currentNodes.equals(redisNodes)) { - log.trace("Redis cluster topology is up to date!"); + log.debug("Redis cluster topology is up to date!"); break; } clusterConfig.setClusterNodes(redisNodes); - log.trace("Successfully updated Redis cluster topology, nodes: {}", redisNodes); + log.debug("Successfully updated Redis cluster topology, nodes: {}", redisNodes); break; } catch (Exception e) { - log.debug("Failed to refresh cluster topology using node: {}", node.getHost(), e); + log.warn("Failed to refresh cluster topology using node: {}", node.getHost(), e); } } } catch (Exception e) { log.warn("Failed to refresh cluster topology", e); } + log.trace("Redis cluster refresh topology has finished!"); } private Set getRedisNodes(RedisNode node, Jedis jedis) {