ArafatKhan2198 commented on code in PR #6640:
URL: https://github.com/apache/ozone/pull/6640#discussion_r1601801138
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -567,6 +594,41 @@ public boolean syncDataFromOM() {
return true;
}
+ private void checkAndValidateReconDbPermissions() {
+ File dbDir = new File(omSnapshotDBParentDir.getPath());
+ if (!dbDir.exists()) {
+ LOG.error("Recon DB directory does not exist: {}",
dbDir.getAbsolutePath());
+ return;
+ }
+
+ try {
+ // Fetch expected permissions from configuration
+ String expectedPermissions =
+ ServerUtils.getPermissions(ReconConfigKeys.OZONE_RECON_DB_DIR,
configuration);
+ String expectedPermissionsSymbolic =
+ ReconUtils.convertNumericToSymbolic(expectedPermissions);
+
+ // Get actual permissions
+ Set<PosixFilePermission> actualPermissions =
+ Files.getPosixFilePermissions(dbDir.toPath());
+ String actualPermissionsStr =
+ PosixFilePermissions.toString(actualPermissions);
+
+ if (!expectedPermissionsSymbolic.equals(actualPermissionsStr)) {
+ LOG.warn("Permissions for Recon DB directory '{}' are set to '{}', but
expected '{}'",
+ dbDir.getAbsolutePath(), actualPermissionsStr,
expectedPermissionsSymbolic);
+ } else {
+ LOG.info("Permissions for Recon DB directory '{}' are correctly set to
'{}'",
Review Comment:
`checkAndValidateReconDbPermissions` will be called by
`updateReconOmDBWithNewSnapshot` which will only get called when the full DB
sync happens once which will be for the first time, I believe it wont flood the
logs as much.
--
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]