[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>
This commit is contained in:
Mingyu Chen
2024-07-17 13:45:32 +08:00
committed by GitHub
parent cf5c555223
commit f2cf8b7d6f
2 changed files with 3 additions and 3 deletions

View File

@ -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();
}

View File

@ -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<String> hosts = Sets.newHashSet();
ImmutableMap<Long, Backend> idToBackend = idToBackendRef;
for (Backend backend : idToBackend.values()) {
if (aliveOnly && !backend.isAlive()) {
if ((aliveOnly && !backend.isAlive()) || backend.isComputeNode()) {
continue;
}
hosts.add(backend.getHost());