You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2025/03/26 15:14:13 UTC

(ozone) branch master updated: HDDS-12239. (addendum) Volume should not be marked as unhealthy when disk full - fix compile error

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

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new bef4beed82 HDDS-12239. (addendum) Volume should not be marked as unhealthy when disk full - fix compile error
bef4beed82 is described below

commit bef4beed822c565be0be59b071cca18b4d008d0b
Author: Doroszlai, Attila <ad...@apache.org>
AuthorDate: Wed Mar 26 16:12:19 2025 +0100

    HDDS-12239. (addendum) Volume should not be marked as unhealthy when disk full - fix compile error
---
 .../apache/hadoop/ozone/container/common/volume/StorageVolume.java    | 4 ++--
 .../ozone/container/common/volume/TestStorageVolumeHealthChecks.java  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java
index 639317af88..3791d77e67 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java
@@ -627,7 +627,7 @@ public synchronized VolumeCheckResult check(@Nullable Boolean unused)
     // If there are not enough space remaining,
     // to avoid volume failure we can ignore checking disk read/write
     int minimumDiskSpace = healthCheckFileSize * 2;
-    if (volumeInfo.get().getCurrentUsage().getAvailable() < minimumDiskSpace) {
+    if (getCurrentUsage().getAvailable() < minimumDiskSpace) {
       ioTestSlidingWindow.add(true);
       return VolumeCheckResult.HEALTHY;
     }
@@ -646,7 +646,7 @@ public synchronized VolumeCheckResult check(@Nullable Boolean unused)
     // As WRITE keeps happening there is probability, disk has become full during above check.
     // We can check again if disk is full. If it is full,
     // in this case keep volume as healthy so that READ can still be served
-    if (!diskChecksPassed && volumeInfo.get().getCurrentUsage().getAvailable() < minimumDiskSpace) {
+    if (!diskChecksPassed && getCurrentUsage().getAvailable() < minimumDiskSpace) {
       ioTestSlidingWindow.add(true);
       return VolumeCheckResult.HEALTHY;
     }
diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeHealthChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeHealthChecks.java
index 9e16e4f9b7..a3e12a96ee 100644
--- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeHealthChecks.java
+++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeHealthChecks.java
@@ -123,7 +123,7 @@ public void verifyFullVolumeHealthWithDiskReadWriteStatus(StorageVolume.Builder<
     for (boolean result : checkResult) {
       StorageVolume volume = builder.build();
 
-      VolumeUsage usage = volume.getVolumeInfo().get().getUsageForTesting();
+      VolumeUsage usage = volume.getVolumeUsage().get();
       DatanodeConfiguration dnConf = CONF.getObject(DatanodeConfiguration.class);
       int minimumDiskSpace = dnConf.getVolumeHealthCheckFileSize() * 2;
       // Keep remaining space as just less than double of VolumeHealthCheckFileSize.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org