adoroszlai commented on code in PR #7682:
URL: https://github.com/apache/ozone/pull/7682#discussion_r1923280372


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/FSORepairTool.java:
##########
@@ -359,15 +343,10 @@ private void 
handleUnreachableAndUnreferencedObjects(OmVolumeArgs volume, OmBuck
 
           if (!isReachable(dirKey)) {
             if (!isDirectoryInDeletedDirTable(dirKey)) {
-              info("Found unreferenced directory: " + dirKey);
               unreferencedStats.addDir();
 
-              if (!repair) {
-                if (verbose) {
-                  info("Marking unreferenced directory " + dirKey + " for 
deletion.");
-                }
-              } else {
-                info("Deleting unreferenced directory " + dirKey);
+              info("Deleting unreferenced directory " + dirKey);

Review Comment:
   > we should still print individual file and dir information only if the 
verbose flag is given
   
   I don't think that's the case before the patch.
   
   Current code on `master` outputs two messages per dir/file in `--repair` 
mode, regardless of verbosity:
   
   ```
   Found unreferenced directory: 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/dir2
   Deleting unreferenced directory 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/dir2
   Found unreferenced file: 
/-9223372036854768896/-9223372036854768384/-9223372036854767359/file3
   Deleting unreferenced file 
/-9223372036854768896/-9223372036854768384/-9223372036854767359/file3
   Found unreferenced file: 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file1
   Deleting unreferenced file 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file1
   Found unreferenced file: 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file2
   Deleting unreferenced file 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file2
   ```
   
   The second message of each pair is ommitted in dry-run mode without 
`--verbose`:
   
   ```
   Found unreferenced directory: 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/dir2
   Found unreferenced file: 
/-9223372036854768896/-9223372036854768384/-9223372036854767359/file3
   Found unreferenced file: 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file1
   Found unreferenced file: 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file2
   ```
   
   and output with slightly different wording with `--verbose`.
   
   With the patch, one message is output, regardless of `--dry-run` mode (only 
prefix is added/omitted) and verbosity:
   
   ```
   [dry run] Deleting unreferenced directory 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/dir2
   [dry run] Deleting unreferenced file 
/-9223372036854768896/-9223372036854768384/-9223372036854767359/file3
   [dry run] Deleting unreferenced file 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file1
   [dry run] Deleting unreferenced file 
/-9223372036854768896/-9223372036854768384/-9223372036854767871/file2
   ```



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