Copilot commented on code in PR #12013:
URL: https://github.com/apache/ozone/pull/12013#discussion_r4587727625


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/diff/MergeJoinSnapDiffWriter.java:
##########
@@ -521,12 +521,22 @@ private static SnapDiffDependencyEntry 
buildDependencyEntry(long objectId, long
     return new SnapDiffDependencyEntry(objectId, sourceParentId, 
targetParentId, reportEntry);
   }
 
-  private static void orderAndWriteReport(SnapDiffJobStore store, int 
nodeCount,
+  /**
+   * Writes the dependency nodes in dependency order, or in node order when 
the graph has a cycle.
+   *
+   * @return whether the report was written in dependency order
+   */
+  private static boolean orderAndWriteReport(SnapDiffJobStore store, int 
nodeCount,
       DoubleConsumer reportProgress) throws IOException {
     List<Integer> orderedNodeIds;
     try (SnapDiffJobStore.DependencyNodeIterator dependencyEntries = 
store.dependencyNodeIterator()) {
       orderedNodeIds = buildOrderedNodeIds(store.getJobId(), 
dependencyEntries);
     }
+    if (orderedNodeIds == null) {
+      // Node indices are 1-based, so this flushes nodes 1..nodeCount.
+      flushUnorderedDependencyNodes(store, nodeCount + 1);
+      return false;

Review Comment:
   The cycle fallback returns without reporting completion. The last callback 
was at 90%, and `updateJobStatusToDone` does not update the progress field, so 
the completed job remains at 90% in the job metadata. Report `FSO_ORDER_END` 
after the flush, as the successful ordering path does.



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