diff --git a/fe/fe-core/src/main/java/com/starrocks/system/NodeSelector.java b/fe/fe-core/src/main/java/com/starrocks/system/NodeSelector.java index 341056b350c91..fc084fa838286 100644 --- a/fe/fe-core/src/main/java/com/starrocks/system/NodeSelector.java +++ b/fe/fe-core/src/main/java/com/starrocks/system/NodeSelector.java @@ -66,17 +66,18 @@ public List seqChooseBackendIdsByStorageMedium(int backendNum, boolean nee } public Long seqChooseBackendOrComputeId() throws UserException { + if (RunMode.isSharedDataMode()) { + List computeNodes = seqChooseComputeNodes(1, true, false); + if (CollectionUtils.isNotEmpty(computeNodes)) { + return computeNodes.get(0); + } + } + List backendIds = seqChooseBackendIds(1, true, false, null); if (CollectionUtils.isNotEmpty(backendIds)) { return backendIds.get(0); } - if (RunMode.isSharedNothingMode()) { - throw new UserException("No backend alive."); - } - List computeNodes = seqChooseComputeNodes(1, true, false); - if (CollectionUtils.isNotEmpty(computeNodes)) { - return computeNodes.get(0); - } + throw new UserException("No backend or compute node alive."); }