dataroaring commented on code in PR #38834: URL: https://github.com/apache/doris/pull/38834#discussion_r1772461191
########## fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java: ########## @@ -301,11 +340,17 @@ pickedBeId, getId(), partitionId, availableBes.size(), idx, index, return pickedBeId; } - - public List<Long> hashReplicaToBes(String clusterId, boolean isBackGround, int replicaNum) { + public List<Long> hashReplicaToBes(String clusterId, boolean isBackGround, int replicaNum) + throws ComputeGroupException { // TODO(luwei) list should be sorted List<Backend> clusterBes = ((CloudSystemInfoService) Env.getCurrentSystemInfo()) .getBackendsByClusterId(clusterId); + String clusterName = ((CloudSystemInfoService) Env.getCurrentSystemInfo()).getClusterNameByClusterId(clusterId); + if (clusterBes.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: ########## @@ -317,17 +362,19 @@ public List<Long> hashReplicaToBes(String clusterId, boolean isBackGround, int r availableBes.add(be); } } - if (availableBes == null || availableBes.size() == 0) { + if (availableBes.isEmpty()) { if (!isBackGround) { LOG.warn("failed to get available be, clusterId: {}", clusterId); } - return new ArrayList<Long>(); + 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