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/09/20 02:55:05 UTC

[GitHub] [iotdb] SpriCoder commented on a diff in pull request #7361: [IOTDB-4420] Monitor DataNode's remain disk space through cluster heartbeat

SpriCoder commented on code in PR #7361:
URL: https://github.com/apache/iotdb/pull/7361#discussion_r974839627


##########
node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java:
##########
@@ -279,23 +304,26 @@ public NodeStatus getNodeStatus() {
     return status;
   }
 
-  public void handleUnrecoverableError() {
-    handleSystemErrorStrategy.handle();
-  }
-
   public void setNodeStatusToShutdown() {
     logger.info("System will reject write operations when shutting down.");
     this.status = NodeStatus.ReadOnly;
   }
 
   public void setNodeStatus(NodeStatus newStatus) {
-    if (newStatus == NodeStatus.ReadOnly) {
-      logger.error(
-          "Change system status to read-only! Only query statements are permitted!",
-          new RuntimeException("System mode is set to READ_ONLY"));
-    } else {
-      logger.info("Set system mode from {} to {}.", status, newStatus);
-    }
+    logger.info("Set system mode from {} to {}.", status, newStatus);
     this.status = newStatus;
+
+    switch (newStatus) {
+      case Full:
+        logger.warn("Change system status to Full! The disk is running out!");

Review Comment:
   Why not break here?



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