swamirishi commented on code in PR #9132:
URL: https://github.com/apache/ozone/pull/9132#discussion_r2428818166


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotUtils.java:
##########
@@ -149,6 +151,10 @@ public static void createHardLinks(Path dbPath, boolean 
deleteSourceFiles) throw
           }
           String from = parts[1];
           String to = parts[0];
+          String omDbPrefix = OM_DB_NAME + PATH_SEPARATOR;
+          if (to.startsWith(omDbPrefix)) {

Review Comment:
   Please dont add such random if checks. The code is already very complex we 
need to refactor and simplify the existing flow. From what I followed:
   
https://github.com/apache/ozone/blob/9a164854f993b79c5e2bea9839692fac52e7b9f2/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java#L4235-L4238
   We are copying the entire contents into om.db directory and then we move out 
the db.snapshots directory. Why do we have to necessarily have to do this?
   Rather I would have created a metadata directory checkpoint folder and would 
have created all the hardlinks in that directory and would have moved the om.db 
directory to the correct place. then db.snapshots directory to the meta data 
directory to the other. This entire exercise should reduce a lot of complexity 
which we added in the initial snapshot bootstrap implementation



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