ChenSammi commented on code in PR #10781:
URL: https://github.com/apache/ozone/pull/10781#discussion_r4376774642
##########
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:
Will it be better to use getIsVersionEnabled() here instead of
hasIsVersionEnabled() here, to be consistent with OMBucketCreateRequest check?
So if IsVersionEnabled is set but it's false, then it will still succeed, for
old clients.
--
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]