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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3InitiateMultipartUploadRequest.java:
##########
@@ -284,6 +291,35 @@ protected void logResult(OzoneManager ozoneManager,
     }
   }
 
+  protected int resolveMultipartSchemaVersion(
+      MultipartInfoInitiateRequest multipartInfoInitiateRequest) {
+    if (!multipartInfoInitiateRequest.hasSchemaVersion()) {
+      return LEGACY_MPU_SCHEMA_VERSION;
+    }
+    return (int) multipartInfoInitiateRequest.getSchemaVersion();
+  }
+
+  @RequestFeatureValidator(
+      conditions = {
+          ValidationCondition.CLUSTER_NEEDS_FINALIZATION,
+          ValidationCondition.CLUSTER_HAS_MPU_PARTS_TABLE_SPLIT
+      },
+      processingPhase = RequestProcessingPhase.PRE_PROCESS,
+      requestType = Type.InitiateMultiPartUpload
+  )
+  public static OMRequest setSchemaVersionOnInitiateMultipartUpload(
+      OMRequest req, ValidationContext ctx) {
+    MultipartInfoInitiateRequest initiateRequest =
+        req.getInitiateMultiPartUploadRequest();
+
+    // Keep newly initiated MPUs on legacy schema until split parts-table
+    // write/read paths are fully implemented.
+    return req.toBuilder()
+        .setInitiateMultiPartUploadRequest(initiateRequest.toBuilder()
+            .setSchemaVersion(LEGACY_MPU_SCHEMA_VERSION))

Review Comment:
   Hmm, I raised https://github.com/apache/ozone/pull/10588 to implement the 
split table writes.
   Maybe we can merge this PR after that to avoid this situation?
   
   Could you take a look at that PR then, when you get the time?



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