dataroaring commented on code in PR #38834:
URL: https://github.com/apache/doris/pull/38834#discussion_r1772461013
##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudReplica.java:
##########
@@ -257,10 +288,16 @@ private long getAvaliableBeId(String clusterId,
Map<String, List<Long>> clusterT
return -1;
}
- public long hashReplicaToBe(String clusterId, boolean isBackGround) {
+ public long hashReplicaToBe(String clusterId, boolean isBackGround) 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:
##########
@@ -272,11 +309,13 @@ public long hashReplicaToBe(String clusterId, boolean
isBackGround) {
availableBes.add(be);
}
}
- if (availableBes == null || availableBes.size() == 0) {
+ if (availableBes.isEmpty()) {
if (!isBackGround) {
LOG.warn("failed to get available be, clusterId: {}",
clusterId);
}
- 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]