spacemonkd commented on code in PR #10062:
URL: https://github.com/apache/ozone/pull/10062#discussion_r3378215959


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCommitPartRequest.java:
##########
@@ -161,6 +161,33 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
             openKey + "entry is not found in the openKey table",
             KEY_NOT_FOUND);
       }
+
+      if (multipartKeyInfo == null) {
+        // This can occur when user started uploading part by the time commit
+        // of that part happens, in between the user might have requested
+        // abort multipart upload. If we just throw exception, then the data
+        // will not be garbage collected, so move this part to delete table
+        // and throw error.
+        throw new OMException("No such Multipart upload is with specified " +
+            "uploadId " + uploadID,
+            OMException.ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR);
+      }
+
+      // This gate runs in the replicated apply path, so the check must remain
+      // deterministic across replicas for a given log index. MLV advances only
+      // via the Ratis-logged finalize-upgrade request.
+      if (!ozoneManager.getVersionManager()
+          .isAllowed(OMLayoutFeature.MPU_PARTS_TABLE_SPLIT)
+          && multipartKeyInfo.getSchemaVersion() != 0) {
+        throw new OMException("MPU parts-table split behavior is not allowed " 
+
+            "before cluster finalization for commit part request.",
+            
OMException.ResultCodes.NOT_SUPPORTED_OPERATION_PRIOR_FINALIZATION);
+      }
+      if (multipartKeyInfo.getSchemaVersion() == 1) {

Review Comment:
   Yes, I had missed the extra check. However I have modified this now.
   Please refer to 
[this](https://github.com/apache/ozone/pull/10062#discussion_r3378205894) for 
more context.



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