Siyao Meng created HDDS-16813:
---------------------------------

             Summary: Reject external CompleteFinalizeUpgrade requests
                 Key: HDDS-16813
                 URL: https://issues.apache.org/jira/browse/HDDS-16813
             Project: Apache Ozone
          Issue Type: Bug
            Reporter: Siyao Meng


CompleteFinalizeUpgrade is an internal request submitted by 
OMUpgradeFinalizeService through Ratis. However, [normal client 
dispatch|https://github.com/apache/ozone/blob/8ca449147710bb69be1b77b22d24d0f70709f72c/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java#L203]
 also accepts it, and [its 
handler|https://github.com/apache/ozone/blob/8ca449147710bb69be1b77b22d24d0f70709f72c/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/upgrade/OMCompleteFinalizeUpgradeRequest.java#L48]
 inherits preExecute() without rejecting external submissions.

Clients should initiate finalization through StartFinalizeUpgrade. The 
background service then waits for HDDS finalization before submitting 
CompleteFinalizeUpgrade. We should enforce this intended request boundary.

Proposed change:
* Override preExecute() to reject external submissions with INVALID_REQUEST, 
following the existing convention of calling super.preExecute().
* Preserve internal Ratis application, which bypasses preExecute().
* Add external-request regression coverage and update the completion-handler 
tests to exercise internal application directly.

Local validation on master 8ca449147710:
* The external-request regression fails before the fix and passes afterward.
* All 52 related unit tests pass, including internal completion and 
background-service tests.
* Checkstyle and git diff --check pass.
* No live-cluster RPC validation was performed.

[HDDS-16025|https://issues.apache.org/jira/browse/HDDS-16025] / [PR 
#11074|https://github.com/apache/ozone/pull/11074] renamed 
OMFinalizeUpgradeRequest to OMCompleteFinalizeUpgradeRequest and added a 
separate CompleteFinalizeUpgrade command type.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to