smengcl commented on code in PR #3397:
URL: https://github.com/apache/ozone/pull/3397#discussion_r870808246
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -756,6 +814,26 @@ public boolean isGrpcBlockTokenEnabled() {
return grpcBlockTokenEnabled;
}
+ /**
+ * Return config value of {@link OMConfigKeys#OZONE_OM_MULTITENANCY_ENABLED}.
+ */
+ public boolean isS3MultiTenancyEnabled() {
+ return isS3MultiTenancyEnabled;
+ }
+
+ /**
+ * Throws OMException if S3 multi-tenancy is not enabled.
+ */
+ public void checkS3MultiTenancyEnabled() throws OMException {
+ if (isS3MultiTenancyEnabled) {
+ return;
+ }
+
Review Comment:
Hi @neils-dev , thanks for the comment.
I understand the concern. Though the current logic in
`OzoneManager#getS3VolumeContext` will not actually reach the multi-tenancy
branch if the feature is disabled (because `multiTenantManager` will become
null already). This means all attempts to access a tenant volume with a
previously generated tenant accessId will be redirected to the default s3v if
the feature is disabled.
If we do need the check at some point we can easily add the logic at
wherever `getVolume()` is called in S3G. For example here:
https://github.com/apache/ozone/blob/3fd7dc6c77d2eb9a43635c91aa7654e0bdcdc72a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java#L494-L497
`getVolume()` (or `getS3VolumeContext()` on OM) should be the only one that
could be in S3G's call path. The rest of the multi-tenancy specific read/write
requests are only accessible through the CLI client, at least for now.
--
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]