ashishkumar50 commented on code in PR #7830:
URL: https://github.com/apache/ozone/pull/7830#discussion_r1954277947
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/MutableVolumeSet.java:
##########
@@ -482,7 +484,7 @@ public StorageLocationReport[] getStorageReport() {
rootDir = volumeInfo.get().getRootDir();
SpaceUsageSource usage = volumeInfo.get().getCurrentUsage();
scmUsed = usage.getUsedSpace();
- remaining = usage.getAvailable();
+ remaining = volume.getStorageState() ==
HddsVolume.VolumeState.READ_ONLY ? 0 : usage.getAvailable();
Review Comment:
Yes this is good suggestion. Currently in SCM usage CLI it shows aggregated
DN space usage including all volume. We can show count of READ only volume.
Can we do this CLI statistics report change in another Jira?
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -599,35 +600,47 @@ private void cleanTmpDiskCheckDir() {
@Override
public synchronized VolumeCheckResult check(@Nullable Boolean unused)
throws Exception {
+ DiskCheckUtil.ReadWriteStatus readWriteStatus =
DiskCheckUtil.checkPermissions(storageDir);
+
boolean directoryChecksPassed =
- DiskCheckUtil.checkExistence(storageDir) &&
- DiskCheckUtil.checkPermissions(storageDir);
+ DiskCheckUtil.checkExistence(storageDir);
// If the directory is not present or has incorrect permissions, fail the
// volume immediately. This is not an intermittent error.
- if (!directoryChecksPassed) {
+ if (!directoryChecksPassed || readWriteStatus ==
DiskCheckUtil.ReadWriteStatus.READ_FAIL) {
if (Thread.currentThread().isInterrupted()) {
throw new InterruptedException("Directory check of volume " + this +
" interrupted.");
}
return VolumeCheckResult.FAILED;
}
+ if (readWriteStatus == DiskCheckUtil.ReadWriteStatus.WRITE_FAIL) {
+ setState(VolumeState.READ_ONLY);
Review Comment:
For READ failure we are already checking in container meta scanner which
runs every 3 hours, That will take care of marking container unhealthy if
rocksdb doesn't open or read doesn't pass through.
--
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]