SaketaChalamchala opened a new pull request, #12013: URL: https://github.com/apache/ozone/pull/12013
Found by TLA+ model checking and code review of the OM optimized snapshot diff paths under [HDDS-15926](https://issues.apache.org/jira/browse/HDDS-15926), on commit d3b75c75bf9ad475551202477c3a21a3f4b968b7. The patch is generated with Specula (Claude Opus 5.5). ## What changes were proposed in this pull request? For optimized FSO snapshot diff with dependency ordering enabled, a cyclic dependency graph (e.g. two bucket-root files swapping names) used to fail report generation with `IOException` (`Dependency graph cycle for job` …). The job ended `FAILED`, and each subsequent ordered request for the same snapshot pair recomputed the diff and failed again. Unordered requests for the same pair could still complete. This change aligns cycle handling with the existing in-memory dependency node limit fallback: when topological sort detects a cycle, `MergeJoinSnapDiffWriter` writes the report via `flushUnorderedDependencyNodes` in dependency-node index order, returns a successful write with `isReportDependencyOrdered() == false`, and `SnapshotDiffManager` marks the job `DONE` with reason "**Report is dependency unordered.**" The job’s ordered-request flag is unchanged so a later ordered request can reuse the completed job instead of recomputing indefinitely. **Implementation (OM / `MergeJoinSnapDiffWriter`):** - `buildOrderedNodeIds` returns null on a dependency-graph cycle (`WARN` log) instead of throwing. - `orderAndWriteReport` returns `boolean`, flushes unordered nodes on `null`, and propagates the outcome through `dependencyOrderingEnabledRef` in writeReport. - Other graph `IllegalStateExceptions` (non-cycle) are still propagated. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17738 ## How was this patch tested? Unit Test added: - `testDependencyOrderingFallsBackOnCycle` in `TestMergeJoinSnapDiffWriter` (swap-rename scenario), asserting successful write, unordered outcome / `DONE`-style reason, `RENAME a→b` and `RENAME b→a`, same row order as explicit unordered `writeReport`, and no `putOrderedReportEntries`. -- 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]
