smengcl commented on code in PR #10901:
URL: https://github.com/apache/ozone/pull/10901#discussion_r3693791142


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -1312,6 +1334,10 @@ void addToObjectIdMap(Table<String, ? extends 
WithParentObjectId> fsTable,
         }
       }
     }

Review Comment:
   One edge case appears to remain: when `deltaFiles.isEmpty()`, the method 
returns after resetting progress to `0.0`, so it never reaches the terminal 
`1.0` update or emits a stage summary. An empty stage could go directly to 100% 
and log that it was skipped:
   
   ```diff
   -    updateProgress(jobKey, 0.0);
        if (deltaFiles.isEmpty()) {
   +      updateProgress(jobKey, 1.0);
   +      if (LOG.isDebugEnabled()) {
   +        LOG.debug("Skipped object ID map generation for table '{}' because 
there are no delta files, jobId: {}",
   +            fsTable.getName(), jobId);
   +      }
          return;
        }
   +    updateProgress(jobKey, 0.0);
   ```



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -1312,6 +1337,11 @@ void addToObjectIdMap(Table<String, ? extends 
WithParentObjectId> fsTable,
         }
       }
     }
+    updateProgress(jobKey, 1.0);

Review Comment:
   Could we keep the debug log in the same 0-100 unit as the persisted and RPC 
value? `updateProgress(1.0)` stores `100.0`, but the helper logs the raw `1.0` 
with a `%` suffix. The final update therefore logs `1.0%`, and a 10% checkpoint 
logs `0.1%`. This appears to be a one-line behavioral fix:
   
   ```diff
   -      LOG.debug("Completed processing {}% of keys for snapshot diff job 
{}", pct, jobKey);
   +      LOG.debug("Completed processing {}% of keys for snapshot diff job {}",
   +          snapshotDiffJob.getKeysProcessedPct(), jobKey);
   ```



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