errose28 commented on code in PR #7830:
URL: https://github.com/apache/ozone/pull/7830#discussion_r1988049913
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -614,6 +615,14 @@ public synchronized VolumeCheckResult check(@Nullable
Boolean unused)
return VolumeCheckResult.HEALTHY;
}
+ // At least some space required to check disk read/write
+ // If there are not enough space remaining,
+ // to avoid volume failure we can ignore checking disk read/write
+ int minimumDiskSpace = Math.max(healthCheckFileSize * 10, HUNDRED_MB);
+ if (volumeInfo.get().getCurrentUsage().getAvailable() < minimumDiskSpace) {
+ return VolumeCheckResult.HEALTHY;
Review Comment:
We can add a test for this using a combination of passing/failing
`DiskChecks` implementations and incrementing and decrementing the space
available, similar to the existing `testVolumeFullHealth`.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -614,6 +615,14 @@ public synchronized VolumeCheckResult check(@Nullable
Boolean unused)
return VolumeCheckResult.HEALTHY;
}
+ // At least some space required to check disk read/write
+ // If there are not enough space remaining,
+ // to avoid volume failure we can ignore checking disk read/write
+ int minimumDiskSpace = Math.max(healthCheckFileSize * 10, HUNDRED_MB);
+ if (volumeInfo.get().getCurrentUsage().getAvailable() < minimumDiskSpace) {
+ return VolumeCheckResult.HEALTHY;
Review Comment:
This result needs to be added to the sliding window before being returned.
Same below on line 641.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -75,6 +75,7 @@ public abstract class StorageVolume
// The name of the directory where temporary files used to check disk
// health are written to. This will go inside the tmp directory.
public static final String TMP_DISK_CHECK_DIR_NAME = "disk-check";
+ public static final int HUNDRED_MB = 100 * 1024 * 1024;
Review Comment:
If we end up using this value, it would be better represented as `100 *
OzoneConsts.MB`.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -614,6 +615,14 @@ public synchronized VolumeCheckResult check(@Nullable
Boolean unused)
return VolumeCheckResult.HEALTHY;
}
+ // At least some space required to check disk read/write
+ // If there are not enough space remaining,
+ // to avoid volume failure we can ignore checking disk read/write
+ int minimumDiskSpace = Math.max(healthCheckFileSize * 10, HUNDRED_MB);
Review Comment:
This looks a little arbitrary, what's the reasoning behind these number
choices? Something simple like a 2x multiplier on the file size would probably
suffice.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]