You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "rich7420 (via GitHub)" <gi...@apache.org> on 2025/10/29 07:15:20 UTC

[PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

rich7420 opened a new pull request, #9216:
URL: https://github.com/apache/ozone/pull/9216

   ## What changes were proposed in this pull request?
   This PR fixes two issues in the FSO repair tool:
   1. Fixed the DB path handling in getStoreFromPath() to use the actual directory name from the provided path instead of hardcoding "om.db". Now the tool supports any OM DB directory name (e.g., om-db-backup, om-copy).
   
   2. Renamed internal method and report references for better clarity:
   unreachable → pendingToDelete
   unreferenced → orphaned
   
   ## What is the link to the Apache JIRA
   
   Please create an issue in ASF JIRA before opening a pull request, and you need to set the title of the pull
   request which starts with the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)
   
   https://issues.apache.org/jira/browse/HDDS-13825
   
   ## How was this patch tested?
   
   (Please explain how this patch was tested. Ex: unit tests, manual tests, workflow run on the fork git repo.)
   (If this patch involves UI changes, please attach a screenshot; otherwise, remove this.)
   


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


Re: [PR] HDDS-13825. Support custom OM DB name in FSO repair tool [ozone]

Posted by "chungen0126 (via GitHub)" <gi...@apache.org>.
chungen0126 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3643162527

   Thanks @rich7420 for the patch, @adoroszlai @sarvekshayr for the review.


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3471555449

   > @sarvekshayr thanks for the feeback! I'll try to fix it as soon as possible.
   
   Sure, it's a simple test fix. 


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3512021678

   @chungen0126 thanks for the suggestion!


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3509541844

   @rich7420 Please resolve the conflicts in this branch.
   
   @dombizita requesting your review.


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


Re: [PR] HDDS-13825. Support custom OM DB name in FSO repair tool [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3642763474

   @chungen0126 would you like to take another look?


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3472820115

   @sarvekshayr thanks a lot!


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2575819119


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,39 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(ORDER_DRY_RUN)
+  @Test
+  public void testAlternateOmDbDirName() throws Exception {
+    File original = new File(OMStorage.getOmDbDir(cluster.getConf()), OM_DB_NAME);

Review Comment:
   ```suggestion
       File original = new File(dbPath);
   ```



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,39 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(ORDER_DRY_RUN)
+  @Test
+  public void testAlternateOmDbDirName() throws Exception {
+    File original = new File(OMStorage.getOmDbDir(cluster.getConf()), OM_DB_NAME);
+    // Place backup under a different parent directory to ensure we don't
+    // accidentally open the original om.db due to path handling bugs.
+    File backupParent = new File(OMStorage.getOmDbDir(cluster.getConf()), "copy");
+    File backup = new File(backupParent, "om-db-backup");
+
+    if (backup.exists()) {
+      FileUtils.deleteDirectory(backup);
+    }
+    if (backupParent.exists()) {
+      FileUtils.deleteDirectory(backupParent);
+    }
+    boolean created = backupParent.mkdirs();
+    if (!created && !backupParent.exists()) {
+      throw new IOException("Failed to create backup parent directory: " + backupParent);
+    }

Review Comment:
   Please use `@TempDir` instead of manually creating and deleting the extra directory, like this:
   
   ```java
     void testAlternateOmDbDirName(@TempDir File backup)
   ```



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,39 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(ORDER_DRY_RUN)
+  @Test
+  public void testAlternateOmDbDirName() throws Exception {

Review Comment:
   Please move this method up to the other dry-run test cases in `TestFSORepairTool.java`, to avoid mixing tests and helpers.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -367,6 +368,17 @@ private int dryRun(String... args) {
     return execute(true, args);
   }
 
+  private int executeWithDb(boolean dryRun, String omDbPath, String... args) {
+    List<String> argList = new ArrayList<>(Arrays.asList("om", "fso-tree", "--db", omDbPath));
+    if (dryRun) {
+      argList.add("--dry-run");
+    }
+    argList.addAll(Arrays.asList(args));
+
+    return withTextFromSystemIn("y")
+        .execute(() -> cmd.execute(argList.toArray(new String[0])));
+  }
+
   private int execute(boolean dryRun, String... args) {
     List<String> argList = new ArrayList<>(Arrays.asList("om", "fso-tree", "--db", dbPath));

Review Comment:
   - Please avoid code duplication.  Either make `execute` delegate to this new method, or simply add the new parameter to `execute`.  I prefer the second option, since there are few callers, so the change is not too big.
   - Move `String omDbPath` parameter to be the first, to avoid confusion with `String... args`.



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


Re: [PR] HDDS-13825. Support custom OM DB name in FSO repair tool [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3644583046

   Thanks @adoroszlai @chungen0126 @sarvekshayr for your review and suggestions!


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3471493973

   Tested the fix manually.
   
   - Before the fix: When the DB was not named `om.db`, the tool returned a null report, which was unclear and did not indicate the actual issue.
   ```
   $ bin/ozone repair om fso-tree --db=/Users/sarvekshayr/OMDB/om.db --dry-run
   [dry run] No running OM service detected. Proceeding with repair.
   [dry run] Creating database with reachable and unreachable tables at /Users/sarvekshayr/OMDB/temp.db
   [dry run] Processing volume: /benchmarking
   [dry run] Processing bucket: benchmarking/e043069
   ...
   ```
   
   ```
   $ bin/ozone repair om fso-tree --db=/Users/sarvekshayr/OMDB/copy/om-db-backup --dry-run
   [dry run] No running OM service detected. Proceeding with repair.
   [dry run] Creating database with reachable and unreachable tables at /Users/sarvekshayr/OMDB/copy/temp.db
   [dry run] 
   Reachable:
           Directories: 0
           Files: 0
           Bytes: 0
   Unreachable (Pending to delete):
           Directories: 0
           Files: 0
           Bytes: 0
   Unreferenced (Orphaned):
           Directories: 0
           Files: 0
           Bytes: 0
   ```
   - After the fix: The tool now accepts any DB name, and the report is generated correctly with no ambiguity.
   ```
   $ bin/ozone repair om fso-tree --db=/Users/sarvekshayr/OMDB/om.db --dry-run
   [dry run] No running OM service detected. Proceeding with repair.
   [dry run] Creating database with reachable and unreachable tables at /Users/sarvekshayr/OMDB/temp.db
   [dry run] Processing volume: /benchmarking
   [dry run] Processing bucket: benchmarking/e043069
   ...
   ```
   
   ```
   $ bin/ozone repair om fso-tree --db=/Users/sarvekshayr/OMDB/copy/om-db-backup --dry-run
   [dry run] No running OM service detected. Proceeding with repair.
   [dry run] Creating database with reachable and unreachable tables at /Users/sarvekshayr/OMDB/copy/temp.db
   [dry run] Processing volume: /benchmarking
   [dry run] Processing bucket: benchmarking/e043069
   ...
   ```
   


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2480619062


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,40 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(2)
+  @Test
+  public void testAlternateOmDbDirNameDryRun() throws Exception {

Review Comment:
   Use `fullReport` for 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: 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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3462427420

   > should I add a function to test the part of "any OM DB directory name"?
   
   Yes, it would be good to add a test in `TestFSORepairTool` to verify different om db names. 


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3472139044

   @sarvekshayr thanks a lot! I've tried to modify function like you said. 


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3471552483

   @sarvekshayr thanks for the feeback! I'll try to fix it as soon as possible.


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3471249427

   @sarvekshayr thanks for your feedback! I've added a test and ci test passed!  
   https://github.com/rich7420/ozone/actions/runs/18930068530
   


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


Re: [PR] HDDS-13825. Support custom OM DB name in FSO repair tool [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2594611283


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -189,7 +191,7 @@ public void testUnreachableObjectsWithParentInDeletedTable() {
   void testConnectedTreeOneBucket(boolean dryRun) {
     String expectedOutput = serializeReport(vol1Report);
 
-    int exitCode = execute(dryRun, "-v", "/vol1", "-b", "bucket1");
+    int exitCode = execute(null, dryRun, "-v", "/vol1", "-b", "bucket1");

Review Comment:
   Pass `dbPath` instead of `null`.  It's easier to read and less error-prone.
   
   ```suggestion
       int exitCode = execute(dbPath, dryRun, "-v", "/vol1", "-b", "bucket1");
   ```



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -360,15 +381,17 @@ public void validateClusterAfterRestart() throws Exception {
   }
 
   private int repair(String... args) {
-    return execute(false, args);
+    return execute(null, false, args);

Review Comment:
   ```suggestion
       return execute(dbPath, false, args);
   ```



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -360,15 +381,17 @@ public void validateClusterAfterRestart() throws Exception {
   }
 
   private int repair(String... args) {
-    return execute(false, args);
+    return execute(null, false, args);
   }
 
   private int dryRun(String... args) {
-    return execute(true, args);
+    return execute(null, true, args);
   }
 
-  private int execute(boolean dryRun, String... args) {
-    List<String> argList = new ArrayList<>(Arrays.asList("om", "fso-tree", "--db", dbPath));
+  private int execute(String customDbPath, boolean dryRun, String... args) {
+    String effectiveDbPath = customDbPath != null ? customDbPath : dbPath;

Review Comment:
   ```suggestion
     private int execute(String effectiveDbPath, boolean dryRun, String... args) {
   ```



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -360,15 +381,17 @@ public void validateClusterAfterRestart() throws Exception {
   }
 
   private int repair(String... args) {
-    return execute(false, args);
+    return execute(null, false, args);
   }
 
   private int dryRun(String... args) {
-    return execute(true, args);
+    return execute(null, true, args);

Review Comment:
   ```suggestion
       return execute(dbPath, true, args);
   ```



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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2480292991


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,30 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(2)
+  @Test
+  public void testAlternateOmDbDirNameDryRun() throws Exception {

Review Comment:
   This test currently passes with or without the fix because the previous implementation always expected `om.db`. Since `om.db` happens to exist in the same directory as `om-db-backup`, the tool silently picks up `om.db` and generates a valid report instead of returning a null report, which hides the bug. You can verify this behaviour once.
   
   To properly validate the fix, please update the test so that `om.db` resides in a different path than `om-db-backup`.
   
   Before the fix: the test should produce a null report.
   After the fix: the test should correctly generate the report for the provided DB path.



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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2480563151


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,40 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(2)
+  @Test
+  public void testAlternateOmDbDirNameDryRun() throws Exception {

Review Comment:
   We should assert the actual report values to ensure the report is not null, just verifying the presence of report fields is not enough.
   
   Update the test to:
   - change the order
   - rename the method
   - place it after all dry run tests
   - validate the report content instead of only checking for field existence.
   ```
     @Order(ORDER_DRY_RUN)
     @Test
     public void testAlternateOmDbDirName() throws Exception {
       File original = new File(OMStorage.getOmDbDir(cluster.getConf()), OM_DB_NAME);
       // Place backup under a different parent directory to ensure we don't
       // accidentally open the original om.db due to path handling bugs.
       File backupParent = new File(OMStorage.getOmDbDir(cluster.getConf()), "copy");
       File backup = new File(backupParent, "om-db-backup");
   
       if (backup.exists()) {
         FileUtils.deleteDirectory(backup);
       }
       if (backupParent.exists()) {
         FileUtils.deleteDirectory(backupParent);
       }
       boolean created = backupParent.mkdirs();
       if (!created && !backupParent.exists()) {
         throw new IOException("Failed to create backup parent directory: " + backupParent);
       }
       FileUtils.copyDirectory(original, backup);
   
       out.reset();
       String expectedOutput = serializeReport(vol1Report);
   
       int exitCode = executeWithDb(true, backup.getPath(), "-v", "/vol1", "-b", "bucket1");
       assertEquals(0, exitCode, err.getOutput());
   
       String cliOutput = out.getOutput();
       String reportOutput = extractRelevantSection(cliOutput);
       assertEquals(expectedOutput, reportOutput);
   
       FileUtils.deleteDirectory(backupParent);
     }
   ```



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


Re: [PR] HDDS-13825. Support custom OM DB name in FSO repair tool [ozone]

Posted by "chungen0126 (via GitHub)" <gi...@apache.org>.
chungen0126 merged PR #9216:
URL: https://github.com/apache/ozone/pull/9216


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "chungen0126 (via GitHub)" <gi...@apache.org>.
chungen0126 commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2509791748


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -417,7 +417,7 @@ public static DBStore loadDB(OzoneConfiguration configuration, File metaDir, int
         .build();
   }
 
-  private static DBStoreBuilder newDBStoreBuilder(OzoneConfiguration conf, String name, File dir) {
+  public static DBStoreBuilder newDBStoreBuilder(OzoneConfiguration conf, String name, File dir) {

Review Comment:
   I don't think changing the method access control here is a good idea. Perhaps we can use DBStoreBuilder#newBuilder directly within FSORepairTool.



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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3509630397

   @sarvekshayr thanks for the reminding!


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


Re: [PR] HDDS-13825. Support custom OM DB name in FSO repair tool [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3619294194

   @adoroszlai thanks for the reminding. I'm sorry for so late to update the patch.


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9216:
URL: https://github.com/apache/ozone/pull/9216#issuecomment-3461137163

   I tested with `mvn test -Dtest=TestFSORepairTool -pl hadoop-ozone/integration-test`.


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


Re: [PR] HDDS-13825. Handle invalid OM DB path and rename FSO repair report fields for clarity [ozone]

Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #9216:
URL: https://github.com/apache/ozone/pull/9216#discussion_r2480563151


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/om/TestFSORepairTool.java:
##########
@@ -378,6 +390,40 @@ private int execute(boolean dryRun, String... args) {
         .execute(() -> cmd.execute(argList.toArray(new String[0])));
   }
 
+  @Order(2)
+  @Test
+  public void testAlternateOmDbDirNameDryRun() throws Exception {

Review Comment:
   We should assert the actual report values to ensure the report is not null, just verifying the presence of report fields is not enough.
   
   Update the test to:
   - change the order
   - rename the method
   - place it after all dry run tests
   - validate the report content instead of only checking for field existence.
   ```
     @Order(ORDER_DRY_RUN)
     @Test
     public void testAlternateOmDbDirName() throws Exception {
       File original = new File(OMStorage.getOmDbDir(cluster.getConf()), OM_DB_NAME);
       // Place backup under a different parent directory to ensure we don't
       // accidentally open the original om.db due to path handling bugs.
       File backupParent = new File(OMStorage.getOmDbDir(cluster.getConf()), "copy");
       File backup = new File(backupParent, "om-db-backup");
   
       if (backup.exists()) {
         FileUtils.deleteDirectory(backup);
       }
       if (backupParent.exists()) {
         FileUtils.deleteDirectory(backupParent);
       }
       boolean created = backupParent.mkdirs();
       if (!created && !backupParent.exists()) {
         throw new IOException("Failed to create backup parent directory: " + backupParent);
       }
       FileUtils.copyDirectory(original, backup);
   
       out.reset();
       String expectedOutput = serializeReport(fullReport);
   
       int exitCode = executeWithDb(true, backup.getPath());
       assertEquals(0, exitCode, err.getOutput());
   
       String cliOutput = out.getOutput();
       String reportOutput = extractRelevantSection(cliOutput);
       assertEquals(expectedOutput, reportOutput);
   
       FileUtils.deleteDirectory(backupParent);
     }
   ```



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