From ca88b0896b3e5ced68f8357ff054bd073e52106e Mon Sep 17 00:00:00 2001 From: yifuzhou Date: Tue, 24 Sep 2024 19:52:08 +0800 Subject: [PATCH] add proxy delete log --- .../DefaultDelayPingActionCollector.java | 1 + .../route/AbstractRouteHealthEventProcessor.java | 1 + .../redis/checker/impl/CheckerProxyManager.java | 13 +++++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/DefaultDelayPingActionCollector.java b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/DefaultDelayPingActionCollector.java index a37d11c2d..f9a826385 100644 --- a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/DefaultDelayPingActionCollector.java +++ b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/DefaultDelayPingActionCollector.java @@ -187,6 +187,7 @@ private void onInstanceStateChange(Object args) { executors.execute(new AbstractExceptionLogTask() { @Override protected void doRun() throws Exception { + logger.debug("[onInstanceStateChange] {}", processor.getClass().getSimpleName()); processor.onEvent((AbstractInstanceEvent) args); } }); diff --git a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/processor/route/AbstractRouteHealthEventProcessor.java b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/processor/route/AbstractRouteHealthEventProcessor.java index e6464f01d..f9684d469 100644 --- a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/processor/route/AbstractRouteHealthEventProcessor.java +++ b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/healthcheck/actions/interaction/processor/route/AbstractRouteHealthEventProcessor.java @@ -80,6 +80,7 @@ public void onEvent(AbstractInstanceEvent event) { @VisibleForTesting protected void doOnEvent(AbstractInstanceEvent instanceSick) { + logger.info("[doOnEvent] {}", instanceSick.getInstance().getEndpoint()); ProxyTunnelInfo proxyTunnelInfo = findProxyTunnelInfo(instanceSick); if (proxyTunnelInfo == null) { logger.warn("[doOnEvent]proxy chain not found for {}", instanceSick); diff --git a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/impl/CheckerProxyManager.java b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/impl/CheckerProxyManager.java index 5ba36c2ad..93ca9441d 100644 --- a/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/impl/CheckerProxyManager.java +++ b/redis/redis-checker/src/main/java/com/ctrip/xpipe/redis/checker/impl/CheckerProxyManager.java @@ -82,8 +82,17 @@ public List getAllProxyTunnels() { @Override public ProxyTunnelInfo getProxyTunnelInfo(String backupDcId, String clusterId, String shardId, String peerDcId) { - if (!clusterServer.amILeader()) return null; - return proxyTunnelInfos.get(new DcClusterShardPeer(backupDcId, clusterId, shardId, peerDcId)); + if (!clusterServer.amILeader()) { + logger.info("[getProxyTunnelInfo] not leader"); + return null; + } + DcClusterShardPeer dcClusterShardPeer = new DcClusterShardPeer(backupDcId, clusterId, shardId, peerDcId); + ProxyTunnelInfo proxyTunnelInfo = proxyTunnelInfos.get(dcClusterShardPeer); + if (proxyTunnelInfo == null) { + logger.info("[getProxyTunnelInfo][unfound]{}", dcClusterShardPeer); + logger.debug("[getProxyTunnelInfo]{}", proxyTunnelInfos.keySet()); + } + return proxyTunnelInfo; } @Override