This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new bc048a3e369 [bugfix](fe) should use equals not == to get failed to select replica message (#45602) bc048a3e369 is described below commit bc048a3e3693bccf9c8f85be9cc51e01a854592f Author: yiguolei <guo...@selectdb.com> AuthorDate: Wed Dec 18 22:26:26 2024 +0800 [bugfix](fe) should use equals not == to get failed to select replica message (#45602) ### What problem does this PR solve? The original code use == to filter tag, it is wrong. --- fe/fe-core/src/main/java/org/apache/doris/qe/SimpleScheduler.java | 3 ++- .../src/main/java/org/apache/doris/system/BeSelectionPolicy.java | 3 ++- .../src/main/java/org/apache/doris/system/SystemInfoService.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SimpleScheduler.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SimpleScheduler.java index 0cafcae58ca..cb8a4ecc34c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SimpleScheduler.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SimpleScheduler.java @@ -178,7 +178,8 @@ public class SimpleScheduler { } blacklistBackends.put(backendID, Pair.of(Config.blacklist_duration_second + 1, reason)); - LOG.warn("add backend {} to black list. reason: {}", backendID, reason); + // Should print the exception stack, so that we will know when it is added to blacklist. + LOG.warn("add backend {} to black list. reason: {}", backendID, reason, new Exception()); } public static boolean isAvailable(Backend backend) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/BeSelectionPolicy.java b/fe/fe-core/src/main/java/org/apache/doris/system/BeSelectionPolicy.java index f8e4429a16d..dd70589f698 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/system/BeSelectionPolicy.java +++ b/fe/fe-core/src/main/java/org/apache/doris/system/BeSelectionPolicy.java @@ -237,7 +237,8 @@ public class BeSelectionPolicy { @Override public String toString() { - return String.format("computeNode=%s | query=%s | load=%s | schedule=%s | tags=%s(%s) | medium=%s", + return String.format("computeNode=%s | query=%s | load=%s | schedule=%s | tags=%s |" + + "resource_downgrade=%s | medium=%s", preferComputeNode, needQueryAvailable, needLoadAvailable, needScheduleAvailable, resourceTags.stream().map(tag -> tag.toString()).collect(Collectors.joining(",")), this.allowResourceTagDowngrade, storageMedium); diff --git a/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java b/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java index 0ca452992f7..662455c87df 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java +++ b/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java @@ -563,7 +563,7 @@ public class SystemInfoService { StringBuilder sb = new StringBuilder(" Backends details: "); for (Tag tag : replicaAlloc.getAllocMap().keySet()) { sb.append("backends with tag ").append(tag).append(" is "); - sb.append(idToBackendRef.values().stream().filter(be -> be.getLocationTag() == tag) + sb.append(idToBackendRef.values().stream().filter(be -> be.getLocationTag().equals(tag)) .map(Backend::getDetailsForCreateReplica) .collect(Collectors.toList())); sb.append(", "); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org