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/09/14 19:28:26 UTC

[GitHub] [ozone] neils-dev commented on a diff in pull request #3750: HDDS-7217. OM logs wrong bucket layout

neils-dev commented on code in PR #3750:
URL: https://github.com/apache/ozone/pull/3750#discussion_r971210510


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/OMRequestTestUtils.java:
##########
@@ -531,7 +531,8 @@ public static void addBucketToDB(String volumeName, String bucketName,
 
   public static OzoneManagerProtocolProtos.OMRequest createBucketRequest(
       String bucketName, String volumeName, boolean isVersionEnabled,
-      OzoneManagerProtocolProtos.StorageTypeProto storageTypeProto) {
+      OzoneManagerProtocolProtos.StorageTypeProto storageTypeProto,
+      int clientVersion) {

Review Comment:
   Is the `clientVersion` necessary for the tests, or can we just use the static from `ClientVersion`?



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/bucket/TestOMBucketCreateRequest.java:
##########
@@ -76,7 +76,7 @@ public void testValidateAndUpdateCacheWithNoVolume() throws Exception {
     String bucketName = UUID.randomUUID().toString();
 
     OMRequest originalRequest = OMRequestTestUtils.createBucketRequest(
-        bucketName, volumeName, false, StorageTypeProto.SSD);
+        bucketName, volumeName, false, StorageTypeProto.SSD, 0);

Review Comment:
   Same comment as previous on clientversion: 0 replaced with` ClientVersion.CURRENT_VERSION`.



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithOMResponse.java:
##########
@@ -469,7 +469,7 @@ private OMBucketCreateResponse createBucket(String volumeName,
 
     OzoneManagerProtocolProtos.OMRequest omRequest =
         OMRequestTestUtils.createBucketRequest(bucketName, volumeName, false,
-            OzoneManagerProtocolProtos.StorageTypeProto.DISK);
+            OzoneManagerProtocolProtos.StorageTypeProto.DISK, 0);

Review Comment:
   Is it necessary to change the TestUtils `createBucketRequest `interface to include the client version?  Or can we just set it within the tests when needed with the static variable `ClientVersion.CURRENT_VERSION`?
   If we leave the interface changed to include the clientVersion (line 535), change the call in line 472 from 
   `OzoneManagerProtocolProtos.StorageTypeProto.DISK, 0`) to
   `OzoneManagerProtocolProtos.StorageTypeProto.DISK, ClientVersion.CURRENT_VERSION`)



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/TestOMClientRequestWithUserInfo.java:
##########
@@ -95,7 +95,7 @@ public void testUserInfo() throws Exception {
     String volumeName = UUID.randomUUID().toString();
     OzoneManagerProtocolProtos.OMRequest omRequest =
         OMRequestTestUtils.createBucketRequest(bucketName, volumeName, true,
-            OzoneManagerProtocolProtos.StorageTypeProto.DISK);
+            OzoneManagerProtocolProtos.StorageTypeProto.DISK, 0);

Review Comment:
   Change the constant 0 to use the `ClientVersion.CURRENT_VERSION` if possible.



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/bucket/TestOMBucketCreateRequest.java:
##########
@@ -145,7 +145,7 @@ private OMBucketCreateRequest doPreExecute(String volumeName,
     addCreateVolumeToTable(volumeName, omMetadataManager);
     OMRequest originalRequest =
         OMRequestTestUtils.createBucketRequest(bucketName, volumeName, false,
-            StorageTypeProto.SSD);
+            StorageTypeProto.SSD, 0);

Review Comment:
   clientVersion set from 0 to `ClientVersion.CURRENT_VERSION`



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