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/02/02 05:35:03 UTC

[GitHub] [ozone] kerneltime commented on a change in pull request #3031: HDDS-6182 Basic framework for Client and OM versioning

kerneltime commented on a change in pull request #3031:
URL: https://github.com/apache/ozone/pull/3031#discussion_r797287851



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OMManagerClientVersionValidations.java
##########
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.protocolPB;
+
+import org.apache.hadoop.ozone.ClientVersions;
+import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
+
+/**
+ * OMManagerClientVersionValidations is a collection of validations to run for
+ * OM RPC calls and Client version compatibility.
+ */
+public final class OMManagerClientVersionValidations {
+  private OMManagerClientVersionValidations() {
+
+  }
+
+  public static void validateClientVersionPostProcess(
+      OzoneManagerProtocolProtos.Type lookupKey,
+      OzoneManagerProtocolProtos.OMRequest request,
+      OzoneManagerProtocolProtos.InfoBucketResponse infoBucketResponse) {
+    // ToDo: Add EC specific rejection of request based on key info.
+    if (request.hasVersion()
+        &&
+        ClientVersions.isClientCompatible(
+            ClientVersions.CLIENT_EC_CAPABLE,
+            request.getVersion())){
+      return;
+    }
+  }
+  public static void validateClientVersionPostProcess(
+      OzoneManagerProtocolProtos.Type lookupKey,
+      OzoneManagerProtocolProtos.OMRequest request,
+      OzoneManagerProtocolProtos.LookupKeyResponse lookupKeyResponse) {
+    // ToDo: Add FSO specific rejection of request based on bucket info.

Review comment:
       How will the pre process know that the bucket is a FSO bucket. If the `Pre` step accesses the bucket then in the normal path, we will be accessing the same bucket information twice and this might be wasteful or the code path could have to be changed to pass the bucket info around? Also, the client might not have permission for the bucket in which case the error should be around access denied and not a compatibility error. Checking for compatibility post allows for other errors and checks to still function and add comptability as a layer on top.




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