sumitagrawl commented on code in PR #7830:
URL: https://github.com/apache/ozone/pull/7830#discussion_r1949107909
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/DiskCheckUtil.java:
##########
@@ -105,31 +110,31 @@ public boolean checkExistence(File diskDir) {
}
@Override
- public boolean checkPermissions(File storageDir) {
+ public ReadWriteStatus checkPermissions(File storageDir) {
// Check all permissions on the volume. If there are multiple permission
// errors, count it as one failure so the admin can fix them all at once.
- boolean permissionsCorrect = true;
+ ReadWriteStatus readWriteStatus = ReadWriteStatus.READ_WRITE_OK;
if (!storageDir.canRead()) {
logError(storageDir,
"Datanode does not have read permission on volume.");
- permissionsCorrect = false;
+ readWriteStatus = ReadWriteStatus.READ_FAIL;
}
if (!storageDir.canWrite()) {
logError(storageDir,
"Datanode does not have write permission on volume.");
- permissionsCorrect = false;
+ readWriteStatus = ReadWriteStatus.WRITE_FAIL;
Review Comment:
readWriteStatus is overwrittn with next check, so it should be done in order
and avoid overwrite as read failure is volume failure, but write failure
converted to Readonly,.,
1. read check -- make readFail
2. execute check -- make read fail
3. write check
--
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]