You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/08/17 08:02:22 UTC

[GitHub] [iotdb] BanDuWuZi commented on a diff in pull request #7031: [IOTDB-4084] remove DataNode with exit code

BanDuWuZi commented on code in PR #7031:
URL: https://github.com/apache/iotdb/pull/7031#discussion_r947578957


##########
server/src/main/java/org/apache/iotdb/db/service/DataNodeServerCommandLine.java:
##########
@@ -158,8 +154,10 @@ private void removeNodesFromCluster(String[] args) throws BadNodeUrlException {
     try (ConfigNodeClient configNodeClient = new ConfigNodeClient()) {
       TDataNodeRemoveResp removeResp = configNodeClient.removeDataNode(removeReq);
       logger.info("Remove result {} ", removeResp.toString());
-    } catch (TException e) {
-      logger.error("send remove Data Node request failed!", e);
+      if (removeResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+        throw new IoTDBException(
+            removeResp.getStatus().toString(), removeResp.getStatus().getCode());

Review Comment:
   ConfigNode returned status has more detail message,  In my test case, it is :
   
   org.apache.iotdb.commons.exception.IoTDBException: TSStatus(code:916, message:lack replication, allow most removed Data Node size : 0)
   	at org.apache.iotdb.db.service.DataNodeServerCommandLine.removeNodesFromCluster(DataNodeServerCommandLine.java:224)



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org