Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ public synchronized DataSet registerAINode(TAINodeRegisterReq req) {
public TSStatus removeAINode() {
// check if the node exists
if (nodeInfo.getRegisteredAINodes().isEmpty()) {
return new TSStatus(TSStatusCode.REMOVE_AI_NODE_ERROR.getStatusCode())
return new TSStatus(TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode())
.setMessage("Remove AINode failed because there is no AINode in the cluster.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3550,15 +3550,16 @@ public SettableFuture<ConfigTaskResult> removeAINode(
LOGGER.info("Starting to remove AINode");
try (ConfigNodeClient configNodeClient =
CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
TShowClusterResp showClusterResp = configNodeClient.showCluster();
if (showClusterResp.getAiNodeListSize() < 1) {
LOGGER.error("Remove AINode failed because there is no AINode in the cluster.");
future.setException(
new IOException("Remove AINode failed because there is no AINode in the cluster."));
return future;
}
TSStatus status = configNodeClient.removeAINode(new TAINodeRemoveReq());
if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
if (status.getCode() == TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode()) {
LOGGER.warn("Remove AINode failed because there is no AINode in the cluster.");
future.set(
new ConfigTaskResult(
new TSStatus(TSStatusCode.NO_REGISTERED_AI_NODE_ERROR.getStatusCode())
.setMessage(
"Remove AINode failed because there is no AINode in the cluster.")));
return future;
} else if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
future.setException(new IOException("Remove AINode failed: " + status.getMessage()));
return future;
} else {
Expand Down
Loading