dataroaring commented on code in PR #38834: URL: https://github.com/apache/doris/pull/38834#discussion_r1772460265
########## fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java: ########## @@ -91,17 +93,26 @@ private boolean isColocated() { return Env.getCurrentColocateIndex().isColocateTable(tableId); } - private long getColocatedBeId(String cluster) { + private long getColocatedBeId(String cluster) throws ComputeGroupException { List<Backend> bes = ((CloudSystemInfoService) Env.getCurrentSystemInfo()).getBackendsByClusterId(cluster); + String clusterName = ((CloudSystemInfoService) Env.getCurrentSystemInfo()).getClusterNameByClusterId(cluster); + if (bes.isEmpty()) { + throw new ComputeGroupException( + String.format("There are no Backend nodes in the current cluster %s", clusterName), Review Comment: current compute group ########## fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java: ########## @@ -91,17 +93,26 @@ private boolean isColocated() { return Env.getCurrentColocateIndex().isColocateTable(tableId); } - private long getColocatedBeId(String cluster) { + private long getColocatedBeId(String cluster) throws ComputeGroupException { List<Backend> bes = ((CloudSystemInfoService) Env.getCurrentSystemInfo()).getBackendsByClusterId(cluster); + String clusterName = ((CloudSystemInfoService) Env.getCurrentSystemInfo()).getClusterNameByClusterId(cluster); + if (bes.isEmpty()) { + throw new ComputeGroupException( + String.format("There are no Backend nodes in the current cluster %s", clusterName), + ComputeGroupException.FailedTypeEnum.CURRENT_COMPUTE_GROUP_NO_BE); + } List<Backend> availableBes = new ArrayList<>(); for (Backend be : bes) { if (be.isAlive()) { availableBes.add(be); } } - if (availableBes == null || availableBes.size() == 0) { + + if (availableBes.isEmpty()) { LOG.warn("failed to get available be, clusterId: {}", cluster); - return -1; + throw new ComputeGroupException( + String.format("All the Backend nodes in the current cluster %s are in an abnormal state", clusterName), Review Comment: current compute group -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org