From f2cf8b7d6fb61950cde7431ef305a41815502ef3 Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Wed, 17 Jul 2024 13:45:32 +0800 Subject: [PATCH] [Fix](InternalSchema) Compute nodes should not be used for Internal schema three replica (#36130) (#37961) bp #36130 Co-authored-by: HB <137497191@qq.com> Co-authored-by: camby <104178625@qq.com> --- .../org/apache/doris/catalog/InternalSchemaInitializer.java | 2 +- .../main/java/org/apache/doris/system/SystemInfoService.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java index 0e12367210..6e4e9a96f4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/InternalSchemaInitializer.java @@ -102,7 +102,7 @@ public class InternalSchemaInitializer extends Thread { return; } while (true) { - int backendNum = Env.getCurrentSystemInfo().getBackendNumFromDiffHosts(true); + int backendNum = Env.getCurrentSystemInfo().getStorageBackendNumFromDiffHosts(true); if (FeConstants.runningUnitTest) { backendNum = Env.getCurrentSystemInfo().getAllBackendIds().size(); } 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 0dc314240b..56ef540a24 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 @@ -417,11 +417,11 @@ public class SystemInfoService { } // return num of backends that from different hosts - public int getBackendNumFromDiffHosts(boolean aliveOnly) { + public int getStorageBackendNumFromDiffHosts(boolean aliveOnly) { Set hosts = Sets.newHashSet(); ImmutableMap idToBackend = idToBackendRef; for (Backend backend : idToBackend.values()) { - if (aliveOnly && !backend.isAlive()) { + if ((aliveOnly && !backend.isAlive()) || backend.isComputeNode()) { continue; } hosts.add(backend.getHost());