Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open findings
preExecute()always throws, so callingsuper.preExecute(ozoneManager)is unnecessary work and… · NewverifyNoInteractions(ratisServer)makes the test brittle ifOMExecutionFlowstarts consulting… · New The error message is a bit vague for operators/API consumers. Consider making it explicit that… · New
What changed in this PR
Rejects externally-submitted CompleteFinalizeUpgrade OM requests (intended to be internal-only) by failing them during preExecute() with INVALID_REQUEST, while preserving the internal (Ratis-applied) finalize path and updating tests accordingly.
Changes:
- Added a
preExecute()guard inOMCompleteFinalizeUpgradeRequestthat throwsOMException(INVALID_REQUEST)for external submissions. - Updated unit tests to reflect that internal requests bypass
preExecute()and to assertfinalizeUpgrade()invocation on the internal path. - Extended the OM upgrade finalization integration test to verify external rejection and that state/metadata remains unchanged.
| File | Description |
|---|---|
| hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMCompleteFinalizeUpgradeRequest.java | Adds preExecute() rejection for external CompleteFinalizeUpgrade requests via OMException(INVALID_REQUEST). |
| hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/upgrade/TestOMCompleteFinalizeUpgradeRequest.java | Adjusts unit tests for the new preExecute() behavior and adds a regression test ensuring external rejection happens before Ratis submission. |
| hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMUpgradeFinalization.java | Adds integration coverage asserting external rejection doesn’t advance OM version or write the in-progress marker, then normal finalization proceeds. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+59
to
+60
| final OMRequest omRequest = super.preExecute(ozoneManager); | ||
| throw new OMException(omRequest.getCmdType() + " is an internal request", OMException.ResultCodes.INVALID_REQUEST); |
Comment on lines
+75
to
+78
| assertFalse(response.getSuccess()); | ||
| assertEquals(Status.INVALID_REQUEST, response.getStatus()); | ||
| verifyNoInteractions(ratisServer); | ||
| verify(ozoneManager, never()).finalizeUpgrade(); |
| @Override | ||
| public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { | ||
| final OMRequest omRequest = super.preExecute(ozoneManager); | ||
| throw new OMException(omRequest.getCmdType() + " is an internal request", OMException.ResultCodes.INVALID_REQUEST); |
Copilot stopped reviewing on behalf of
smengcl due to an error
October 9, 2026 09:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What changes were proposed in this pull request?
CompleteFinalizeUpgrade is intended for OMUpgradeFinalizeService, but normal client dispatch also accepts it. Reject external submissions in preExecute() with INVALID_REQUEST.
Internal completion continues through direct Ratis submission, which bypasses preExecute(). Update the handler tests accordingly and extend the existing upgrade integration test to cover external rejection followed by normal finalization.
What is the link to the Apache JIRA?
https://issues.apache.org/jira/browse/HDDS-16813
How was this patch tested?
Local validation used JDK 21, Maven 3.9.11, and a non-secure MiniOzoneCluster.
Generated-by: Codex (GPT-6)