ChenSammi commented on code in PR #10781:
URL: https://github.com/apache/ozone/pull/10781#discussion_r4614661525


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketSetPropertyRequest.java:
##########
@@ -388,4 +396,28 @@ public static OMRequest 
disallowSetBucketPropertyWithECReplicationConfig(
     }
     return req;
   }
+
+  @RequestFeatureValidator(
+      conditions = ValidationCondition.CLUSTER_NEEDS_FINALIZATION,
+      processingPhase = RequestProcessingPhase.PRE_PROCESS,
+      requestType = Type.SetBucketProperty
+  )
+  public static OMRequest disallowSetBucketPropertyWithVersioningStatus(
+      OMRequest req, ValidationContext ctx) throws OMException {
+    if 
(!ctx.versionManager().isAllowed(OzoneManagerVersion.S3_OBJECT_VERSIONING)) {
+      SetBucketPropertyRequest propReq =
+          req.getSetBucketPropertyRequest();
+      // The deprecated isVersionEnabled flag also maps to a versioning status.
+      if (propReq.hasBucketArgs()
+          && (propReq.getBucketArgs().hasVersioningStatus()
+          || propReq.getBucketArgs().hasIsVersionEnabled())) {

Review Comment:
   Let's keep the two fields as of now, and mainly focus on the new 
versionStatus field.  We will revisit the this part later to decide how to 
handle the existing data upgrade. 



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