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/01/19 20:57:40 UTC

[GitHub] [ozone] JyotinderSingh opened a new pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

JyotinderSingh opened a new pull request #3004:
URL: https://github.com/apache/ozone/pull/3004


   ## What changes were proposed in this pull request?
   
   The idea here is to add OM#getSupportedLayouts() RPC call to get the bucket layout values. 
   Before finalization OM#getSupportedLayouts() RPC call should return empty values. Now, the new client's OzoneClientAdapter and CreateBucketHandler would get an empty [] list then continue with the existing older version behavior.
   After finalization OM#getSupportedLayouts() RPC call will have values FSO/OBS and the client will have the new behavior.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6200
   
   ## How was this patch tested?
   
   Added related Integration Test.
   


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


[GitHub] [ozone] errose28 commented on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
errose28 commented on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1024446592


   ⬆️  cc @kerneltime who is working on the client versioning.


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


[GitHub] [ozone] rakeshadr commented on a change in pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
rakeshadr commented on a change in pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#discussion_r788660176



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3900,4 +3900,25 @@ private void updateLayoutVersionInDB(OMLayoutVersionManager lvm,
   private BucketLayout getBucketLayout() {
     return BucketLayout.DEFAULT;
   }
+
+  /**
+   * Get supported Bucket Layouts based on upgrade state.
+   * Before finalization, the method returns an empty list. This leads to the
+   * new client's OzoneClientAdapter and CreateBucketHandler receiving an empty
+   * list - which causes them to continue with LEGACY layout.
+   * After finalization, the method returns a list with the new layouts.
+   * @return Supported Bucket Layouts.
+   */
+  public List<BucketLayout> getSupportedBucketLayouts() {

Review comment:
       @JyotinderSingh need to expose this function to `OzoneClientAdapter` and `CreateBucketHandler` so that client can send the default values.




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


[GitHub] [ozone] JyotinderSingh edited a comment on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh edited a comment on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1016867380


   @rakeshadr @errose28 Could you review these changes? This PR is a part of the upgrade effort for the BucketLayout feature.
   
   One of the downsides of my current implementation seems to be as follows:
   If we are performing an upgrade on an Ozone installation that already supports OBS and FSO layouts, to a more recent version - the OM would still return an empty list of supported layouts as the response to `OzoneManager.getSupportedBucketLayouts()`, and not allow its clients to create a new bucket with OBS/FSO layout (which were already supported before the upgrade process began).


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


[GitHub] [ozone] errose28 commented on a change in pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#discussion_r790052854



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3900,4 +3900,26 @@ private void updateLayoutVersionInDB(OMLayoutVersionManager lvm,
   private BucketLayout getBucketLayout() {
     return BucketLayout.DEFAULT;
   }
+
+  /**
+   * Get supported Bucket Layouts based on upgrade state.
+   * Before finalization, the method returns an empty list. This leads to the
+   * new client's OzoneClientAdapter and CreateBucketHandler receiving an empty
+   * list - which causes them to continue with LEGACY layout.
+   * After finalization, the method returns a list with the new layouts.
+   *
+   * @return Supported Bucket Layouts.
+   */
+  public List<BucketLayout> getSupportedBucketLayouts() {
+    // Check if we are in Pre-Finalize upgrade state.
+    if (versionManager.getUpgradeState() ==
+        UpgradeFinalizer.Status.FINALIZATION_REQUIRED) {

Review comment:
       Add FSO as a layout feature in `OMLayoutFeature`. Then you can call `OzoneManager#getVersionManager#isAllowed(OMLayoutFeature.FSO)` to determine whether FSO specifically has been finalized or not. The call written here just checks if the OM needs to be finalized for some layout feature, which may come after FSO. It does not check that FSO specifically has not already been finalized.




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


[GitHub] [ozone] JyotinderSingh edited a comment on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh edited a comment on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1016867380


   @rakeshadr @errose28 Could you review these changes? This PR is a part of the upgrade effort for the BucketLayout feature.
   
   One of the downsides of my current implementation seems to be as follows:
   If we are performing an upgrade on an Ozone installation that already supports OBS and FSO layouts, to a more recent version - the OM would still return an empty list of supported layouts as the response to `OzoneManager.getSupportedBucketLayouts()`, and not allow its clients to create a new bucket with OBS/FSO layout (which was already supported before the upgrade process began).


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


[GitHub] [ozone] JyotinderSingh edited a comment on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh edited a comment on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1016867380


   @rakeshadr @errose28 Could you review these changes and let me know if this is a semantically correct way to go about it? This PR is a part of the upgrade effort for the BucketLayout feature.
   
   One of the downsides of my current implementation seems to be as follows:
   If we are performing an upgrade on an Ozone installation that already supports OBS and FSO layouts, to a more recent version - the OM would still return an empty list of supported layouts as the response to `OzoneManager.getSupportedBucketLayouts()`, and not allow its clients to create a new bucket with OBS/FSO layout (which was already supported before the upgrade process began).


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


[GitHub] [ozone] rakeshadr edited a comment on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
rakeshadr edited a comment on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1024154901


   @errose28 thanks for reviewing this PR.
   
   > Let me know what the current requirements for FSO client interactions are and we can decide whether this is the best way to handle them.
   
   Following is the requirement of FSO feature:
   
   **OM Pre-finalized state**
   *Client CreateBucket behavior in different client end points:*
   ```
   [A] Ozone Shell Command #createBucket:-
          case-1) New-Shell-Client uses default value OBS: 
                "ozone sh  create bucket myBucket"
                 Now, ozone client will send the default value OBS to OM server
         case-2) New-Shell-Client sends explicit value: 
                 "ozone sh create bucket --layout=FSO myFSOBucket"
   
   [B] BasicRootedFileSystem #createBucket:-
         case-3) if the bucket doesn’t exists then ozone client will create a bucket with "FSO" layout.
   ```
   IIUC the simplest option is to handle it by ignoring the bucket layout argument at the OM side and silently creates LEGACY bucket layout with a WARN message. 
   
   On a second thought, I was trying an approach to throw exception if user explicitly specify FSO or OBS layout value in the above mentioned "case-2". But I like your idea of unifying the pre-finalized code for upcoming features. That makes code more maintainable. Since this is a new feature, we have the flexibility to decide the behavior of different FSO cases.
   
   I agree to pause this PR now and would like to see HDDS-6213 proposal patch.


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


[GitHub] [ozone] JyotinderSingh commented on a change in pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh commented on a change in pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#discussion_r788786237



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3900,4 +3900,25 @@ private void updateLayoutVersionInDB(OMLayoutVersionManager lvm,
   private BucketLayout getBucketLayout() {
     return BucketLayout.DEFAULT;
   }
+
+  /**
+   * Get supported Bucket Layouts based on upgrade state.
+   * Before finalization, the method returns an empty list. This leads to the
+   * new client's OzoneClientAdapter and CreateBucketHandler receiving an empty
+   * list - which causes them to continue with LEGACY layout.
+   * After finalization, the method returns a list with the new layouts.
+   * @return Supported Bucket Layouts.
+   */
+  public List<BucketLayout> getSupportedBucketLayouts() {

Review comment:
       Thank you for the review, I have addressed this in my latest patch.




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


[GitHub] [ozone] JyotinderSingh commented on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
JyotinderSingh commented on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1016867380


   @rakeshadr @errose28 Could you review these changes? This PR is a part of the upgrade effort for the BucketLayout feature.
   
   One of the downsides of my current implementation seems to be as follows:
   If we are performing an upgrade on an Ozone installation that already supports OBS and FSO layouts, to a more recent version - the OM would still return an empty list of supported layouts as the response to the `OzoneManager.getSupportedBucketLayouts()`, and not allow its clients to create a new bucket with OBS/FSO layout (which were already supported before the upgrade process began).


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


[GitHub] [ozone] errose28 commented on a change in pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
errose28 commented on a change in pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#discussion_r790047451



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientSupportedBucketLayouts.java
##########
@@ -0,0 +1,126 @@
+/**

Review comment:
       For upgrade integration tests, see `TestOMUpgradeFinalization` for an example. You probably want something like this:
   1. Create a cluster pre-finalized for FSO. You can save on startup time by omitting datanodes.
       `clusterBuilder.setOmLayoutVersion(OMLayoutFeatures.INITIAL_VERSION).withoutDatanodes()`
   2. Run your tests on the cluster pre-finalized.
       - Make sure all buckets are LEGACY.
   3. Finalize the cluster with the client:
       `client.finalizeUpgrade()`
       - You will need to wait for finalization to complete before proceeding. See `TestOMUpgradeFinalization#waitForFinalization`. You probably don't care about the progress messages so you can just wait on the status.
   4. Run your tests on the cluster finalized.
       - Now there can be FSO or OBS buckets.
   
   You will need to add FSO as a layout feature in `OMLayoutFeature`. I don't think FSO needs disk format changes at different stages, so just something following the way INITIAL_VERSION is set up will do.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3900,4 +3900,26 @@ private void updateLayoutVersionInDB(OMLayoutVersionManager lvm,
   private BucketLayout getBucketLayout() {
     return BucketLayout.DEFAULT;
   }
+
+  /**
+   * Get supported Bucket Layouts based on upgrade state.
+   * Before finalization, the method returns an empty list. This leads to the
+   * new client's OzoneClientAdapter and CreateBucketHandler receiving an empty
+   * list - which causes them to continue with LEGACY layout.
+   * After finalization, the method returns a list with the new layouts.
+   *
+   * @return Supported Bucket Layouts.
+   */
+  public List<BucketLayout> getSupportedBucketLayouts() {
+    // Check if we are in Pre-Finalize upgrade state.
+    if (versionManager.getUpgradeState() ==
+        UpgradeFinalizer.Status.FINALIZATION_REQUIRED) {

Review comment:
       Add FSO as a layout feature in `OMLayoutFeature`. Then you can call `OzoneManager#getVersionManager#isAllowed(OMLayoutFeature.FSO)` to determine whether FSO has been finalized or not.




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


[GitHub] [ozone] rakeshadr commented on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
rakeshadr commented on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1024154901


   @errose28 thanks for reviewing this PR.
   
   > Let me know what the current requirements for FSO client interactions are and we can decide whether this is the best way to handle them.
   
   Following is the requirements of the Ozone:
   **OM Pre-finalized state**
   *Client CreateBucket behavior in different client end points:*
   ```
   [A] Ozone Shell Command #createBucket:-
          case-1) New-Shell-Client uses default value OBS: 
                "ozone sh  create bucket myBucket"
                 Now, ozone client will send the default value OBS to OM server
         case-2) New-Shell-Client sends explicit value: 
                 "ozone sh create bucket --layout=FSO myFSOBucket"
   
   [B] BasicRootedFileSystem #createBucket:-
         case-3) if the bucket doesn’t exists then ozone client will create a bucket with "FSO" layout.
   ```
   IIUC the simplest option is to handle it by ignoring the bucket layout argument at the OM side and silently creates LEGACY bucket layout with a WARN message. 
   
   On a second thought, I was trying an approach to throw exception if user explicitly specify FSO or OBS layout value in the above mentioned "case-2". But I like your idea of unifying the pre-finalized code for upcoming features. That makes code more maintainable. Since this is a new feature, we have the flexibility to decide the behavior of different FSO cases.
   
   I agree to pause this PR now and would like to see HDDS-6213 proposal patch.


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


[GitHub] [ozone] errose28 edited a comment on pull request #3004: HDDS-6200. Provide OM#getSupportedBucketLayout RPC call for BucketLayout upgrade finalization.

Posted by GitBox <gi...@apache.org>.
errose28 edited a comment on pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#issuecomment-1024446592


   ⬆️  cc @kerneltime who is working on the client versioning and @fapifta who is working on argument validation.


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