hemantk-12 commented on code in PR #4993:
URL: https://github.com/apache/ozone/pull/4993#discussion_r1244497272


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -792,11 +798,9 @@ boolean areDiffJobAndSnapshotsActive(
     SnapshotInfo toSnapInfo = getSnapshotInfo(ozoneManager, volumeName,
         bucketName, toSnapshotName);
 
-    String jobKey = fromSnapInfo.getSnapshotId() +
-        DELIMITER + toSnapInfo.getSnapshotId();
-
-    if (snapDiffJobTable.get(jobKey).getStatus()
-        .equals(CANCELLED)) {
+    String jobKey = generateSnapDiffJobKey.apply(fromSnapInfo, toSnapInfo);
+    SnapshotDiffJob diffJob = snapDiffJobTable.get(jobKey);
+    if (diffJob == null || diffJob.getStatus() == CANCELLED) {

Review Comment:
   DONE, REJECTED and FAILED should not come to this path. Because one job is 
single thread and once it is marked DONE, REJECTED or FAILED, it won't come to 
this flow. You can create new job after that cleanup of REJECTED or FAILED but 
that would be considered a different job altogether.



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