sumitagrawl commented on code in PR #6640:
URL: https://github.com/apache/ozone/pull/6640#discussion_r1593817424


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -366,6 +374,14 @@ connectionFactory, getOzoneManagerSnapshotUrl(),
       reconUtils.untarCheckpointFile(targetFile, untarredDbDir);
       FileUtils.deleteQuietly(targetFile);
 
+      // Validate the presence of required SST files
+      File[] sstFiles = untarredDbDir.toFile().listFiles((dir, name) -> 
name.endsWith(".sst"));
+      if (sstFiles == null || sstFiles.length == 0) {
+        LOG.warn("No SST files found in the OM snapshot directory: {}", 
untarredDbDir);
+        return null;
+      }
+      LOG.info("Valid OM snapshot with SST files found at: {}", untarredDbDir);

Review Comment:
   can be debug log



##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -264,10 +270,12 @@ private void startSyncDataFromOM(long initialDelay) {
     LOG.debug("Started the OM DB sync scheduler.");
     scheduler.scheduleWithFixedDelay(() -> {
       try {
+        LOG.info("Last known sequence number before sync: {}", 
getCurrentOMDBSequenceNumber());

Review Comment:
   check the frequency of the log ... else recon log will be filled with this 
log only



##########
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 =

Review Comment:
   How are we controlling exact permission? I think depends on OS configuration 
also. IMO, we need set minimum permission required in validation.



-- 
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]

Reply via email to