This is an automated email from the ASF dual-hosted git repository.

yongzao pushed a commit to branch heartbeat-disk-metric-log
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ce0d02184cbd0e9eab79238cbeff28e0bc350ebd
Author: YongzaoDan <[email protected]>
AuthorDate: Wed Jan 3 15:42:40 2024 +0800

    Finish
---
 .../db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
index 237575913b9..3f266f467ed 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java
@@ -1242,6 +1242,7 @@ public class DataNodeInternalRPCServiceImpl implements 
IDataNodeRPCService.Iface
   }
 
   private void sampleDiskLoad(TLoadSample loadSample) {
+    final double byteToGb = 1024 * 1024 * 1024;
     double availableDisk =
         MetricService.getInstance()
             .getAutoGauge(
@@ -1258,6 +1259,7 @@ public class DataNodeInternalRPCServiceImpl implements 
IDataNodeRPCService.Iface
                 Tag.NAME.toString(),
                 SYSTEM)
             .getValue();
+    LOGGER.info("[Heartbeat] disk space: {}, {}", availableDisk, totalDisk);
 
     if (availableDisk != 0 && totalDisk != 0) {
       double freeDiskRatio = availableDisk / totalDisk;
@@ -1266,7 +1268,12 @@ public class DataNodeInternalRPCServiceImpl implements 
IDataNodeRPCService.Iface
       // Reset NodeStatus if necessary
       if (freeDiskRatio < commonConfig.getDiskSpaceWarningThreshold()) {
         LOGGER.warn(
-            "The remaining disk usage ratio:{} is less than 
disk_spec_warning_threshold:{}, set system to readonly!",
+            "The available disk space is : {}GB, "
+                + "the total disk space is : {}GB, "
+                + "and the remaining disk usage ratio: {} is "
+                + "less than disk_spec_warning_threshold: {}, set system to 
readonly!",
+            availableDisk / byteToGb,
+            totalDisk / byteToGb,
             freeDiskRatio,
             commonConfig.getDiskSpaceWarningThreshold());
         commonConfig.setNodeStatus(NodeStatus.ReadOnly);

Reply via email to