jojochuang commented on code in PR #9240:
URL: https://github.com/apache/ozone/pull/9240#discussion_r2487513112


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java:
##########
@@ -297,12 +334,18 @@ Map<UUID, Integer> getSnapshotToBeCheckedForOrphans() {
     return snapshotToBeCheckedForOrphans;
   }
 
-  private void init(OzoneConfiguration configuration, SnapshotChainManager 
chainManager) throws IOException {
+  private void init(OzoneConfiguration configuration, SnapshotChainManager 
chainManager,
+      OMLayoutVersionManager layoutVersionManager,
+      CheckedFunction<SnapshotInfo, OmMetadataManagerImpl, IOException> 
defaultSnapProvider) throws IOException {
     this.locks = omMetadataManager.getHierarchicalLockManager();
     this.snapshotToBeCheckedForOrphans = new ConcurrentHashMap<>();
     RDBStore store = (RDBStore) omMetadataManager.getStore();
     String checkpointPrefix = store.getDbLocation().getName();
     File snapshotDir = new File(store.getSnapshotsParentDir());
+    boolean upgradeNeeded = !layoutVersionManager.isAllowed(SNAPSHOT_DEFRAG);

Review Comment:
   software is updated, but not finalized yet.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotLocalDataManager.java:
##########
@@ -242,6 +253,32 @@ private void addSnapshotVersionMeta(UUID snapshotId, 
SnapshotVersionsMeta snapsh
     }
   }
 
+  private void addMissingSnapshotYamlFiles(
+      CheckedFunction<SnapshotInfo, OmMetadataManagerImpl, IOException> 
defaultSnapProvider) throws IOException {
+    try (Table.KeyValueIterator<String, SnapshotInfo> itr = 
omMetadataManager.getSnapshotInfoTable().iterator()) {
+      while (itr.hasNext()) {
+        SnapshotInfo snapshotInfo = itr.next().getValue();

Review Comment:
   do we need to lock on SNAPSHOT_LOCAL_DATA_LOCK?
   I assume not?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotDefragService.java:
##########
@@ -345,7 +346,8 @@ private boolean shouldRun() {
       return false;
     }
     // The service only runs if current OM node is ready
-    return running.get() && ozoneManager.isRunning();
+    return running.get() && ozoneManager.isRunning() &&

Review Comment:
   OmSnapshotLocalDataManager does not need to start if it's not finalized, too?



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