You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/12/02 00:13:09 UTC

[GitHub] [ozone] GeorgeJahad commented on a diff in pull request #3947: HDDS-3486. Recon cannot track missing containers that were created and went missing while it is down.

GeorgeJahad commented on code in PR #3947:
URL: https://github.com/apache/ozone/pull/3947#discussion_r1037675706


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerManagerFacade.java:
##########
@@ -411,22 +460,102 @@ private void initializeSCMDB() {
       }
     } catch (IOException e) {
       LOG.error("Exception encountered while getting SCM DB.");
+    } finally {
+      isSyncDataFromSCMRunning.compareAndSet(true, false);
     }
   }
 
   public void updateReconSCMDBWithNewSnapshot() throws IOException {
-    DBCheckpoint dbSnapshot = scmServiceProvider.getSCMDBSnapshot();
-    if (dbSnapshot != null && dbSnapshot.getCheckpointLocation() != null) {
-      LOG.info("Got new checkpoint from SCM : " +
-          dbSnapshot.getCheckpointLocation());
+    if (isSyncDataFromSCMRunning.compareAndSet(false, true)) {
+      DBCheckpoint dbSnapshot = scmServiceProvider.getSCMDBSnapshot();
+      if (dbSnapshot != null && dbSnapshot.getCheckpointLocation() != null) {
+        LOG.info("Got new checkpoint from SCM : " +
+            dbSnapshot.getCheckpointLocation());
+        try {
+          initializeNewRdbStore(dbSnapshot.getCheckpointLocation().toFile());
+        } catch (IOException e) {
+          LOG.error("Unable to refresh Recon SCM DB Snapshot. ", e);
+        }
+      } else {
+        LOG.error("Null snapshot location got from SCM.");
+      }
+    } else {
+      LOG.warn("SCM DB sync is already running.");
+    }
+  }
+
+  public boolean syncWithSCMContainerInfo()

Review Comment:
   It would be nice to have a unit test for this method.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org