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 03:13:47 UTC

[GitHub] [iotdb] BanDuWuZi opened a new pull request, #7031: fix IOTDB-4084

BanDuWuZi opened a new pull request, #7031:
URL: https://github.com/apache/iotdb/pull/7031

   https://issues.apache.org/jira/browse/IOTDB-4084
   remove datanode by shell : remove-datanode.sh, it implements in DataNodeServerCommandLine, the class has no exit code ,so I can not use '$?' to show if the remove datanode request is accept or not


-- 
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


[GitHub] [iotdb] wangchao316 merged pull request #7031: [IOTDB-4084] remove DataNode with exit code

Posted by GitBox <gi...@apache.org>.
wangchao316 merged PR #7031:
URL: https://github.com/apache/iotdb/pull/7031


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
Beyyes commented on code in PR #7031:
URL: https://github.com/apache/iotdb/pull/7031#discussion_r947572782


##########
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:
   If it's better to set the error message `send remove Data Node request failed!` in IoTDBException



-- 
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