You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/05/17 16:27:21 UTC

[GitHub] [ozone] avijayanhwx commented on a diff in pull request #3411: HDDS-6681. Post-Finalize behaviour for Bucket Layout feature.

avijayanhwx commented on code in PR #3411:
URL: https://github.com/apache/ozone/pull/3411#discussion_r875026118


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java:
##########
@@ -418,4 +418,37 @@ public static OMRequest disallowCreateBucketWithBucketLayoutDuringPreFinalize(
     }
     return req;
   }
+
+  /**
+   * Validates bucket create requests.
+   * Handles the cases where an older client attempts to create a bucket
+   * (without passing any bucket layout) and the cluster's protobuf definition
+   * defaults the missing value to a non LEGACY layout.
+   * We do not want to allow this to happen, since this would cause the client
+   * to be able to create buckets it cannot understand.
+   *
+   * @param req - the request to validate
+   * @param ctx - the validation context
+   * @return the validated request
+   * @throws OMException if the request is invalid
+   */
+  @RequestFeatureValidator(
+      conditions = ValidationCondition.OLDER_CLIENT_REQUESTS,
+      processingPhase = RequestProcessingPhase.PRE_PROCESS,
+      requestType = Type.CreateBucket
+  )
+  public static OMRequest blockCreateBucketWithBucketLayoutFromOldClient(
+      OMRequest req, ValidationContext ctx) throws OMException {
+    if (req.getCreateBucketRequest().getBucketInfo().hasBucketLayout()
+        &&
+        !BucketLayout.fromProto(req.getCreateBucketRequest().getBucketInfo()

Review Comment:
   How can an older client request a bucket of FSO type? Won't that be absent in the client library?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org