From 54507bb0586f3b2acf7dad6e7556280b24a99f31 Mon Sep 17 00:00:00 2001 From: zhangdong <493738387@qq.com> Date: Wed, 17 May 2023 08:47:11 +0800 Subject: [PATCH] [fix](FQDN)fix Checkpoint error (#19678) Must use Env.getServingEnv() instead of getCurrentEnv(),because here we need to obtain selfNode through the official service catalog. --- .../main/java/org/apache/doris/common/util/HttpURLUtil.java | 4 +++- .../main/java/org/apache/doris/httpv2/meta/MetaService.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/HttpURLUtil.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/HttpURLUtil.java index a5394d6d48..966bc6c66e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/util/HttpURLUtil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/HttpURLUtil.java @@ -31,7 +31,9 @@ public class HttpURLUtil { public static HttpURLConnection getConnectionWithNodeIdent(String request) throws IOException { URL url = new URL(request); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - HostInfo selfNode = Env.getCurrentEnv().getSelfNode(); + // Must use Env.getServingEnv() instead of getCurrentEnv(), + // because here we need to obtain selfNode through the official service catalog. + HostInfo selfNode = Env.getServingEnv().getSelfNode(); conn.setRequestProperty(Env.CLIENT_NODE_HOST_KEY, selfNode.getHost()); conn.setRequestProperty(Env.CLIENT_NODE_PORT_KEY, selfNode.getPort() + ""); return conn; diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/meta/MetaService.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/meta/MetaService.java index 6deea9f0e4..cc0cb47a63 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/meta/MetaService.java +++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/meta/MetaService.java @@ -71,7 +71,7 @@ public class MetaService extends RestBaseController { Frontend fe = Env.getCurrentEnv().checkFeExist(clientHost, clientPort); if (fe == null) { - LOG.warn("request is not from valid FE. client: {}", clientHost); + LOG.warn("request is not from valid FE. client: {}, {}", clientHost, clientPortStr); return false; } return true;