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 2021/10/03 18:27:31 UTC

[GitHub] [ozone] GeorgeJahad opened a new pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

GeorgeJahad opened a new pull request #2703:
URL: https://github.com/apache/ozone/pull/2703


   ## What changes were proposed in this pull request?
   
   When the OM-HA code was added, the tests were not completely updated.  Many of them still call the OzoneManagerProtocol "write-path" methods even though those methods have been superseded by the HA methods.  For this reason the obsolete protocol methods in the OzoneManager class could not be removed.
   
   This PR replaces all those obsolete methods with default methods in OzoneManagerProtocol.java that just throw an UnsupportedOperationException.  
   
   It also fixes the tests broken by those changes.  
   
   ## Unremoved methods
   The following methods are in the OzoneManager class, on the write path.  They were not removed because they are invoked from with the OmRequest subclasses:
   ```
   OzoneManager::finalizeUpgrade
   OzoneManager::getDelegationToken
   OzoneManager::renewDelegationToken
   OzoneManager::cancelDelegationToken
   ```
   
   ## Other dead code removed
   In my testing, I noticed a couple of other methods that are no longer used and removed them as well:
   
   OzoneManager::checkVolumeAccess is unsupported in the [VolumeManagerImpl](https://github.com/apache/ozone/blob/fcd016021452d14371e3335982ee0f7cb72fac5c/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/VolumeManagerImpl.java#L386)
   
   [OzoneManagerRequestHandler::allocateBlock](https://github.com/apache/ozone/blob/e5c647eb65b896d629f8e20e066cccae32834d80/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java#L458) is a private method that is not called from anywhere
   
   
   ## Complex Fixes
   
   Most of the broken tests were easy to fix.  Basically any the tests that invoked the removed methods directly from the OzoneManager.class were modified to invoke them from an OzoneManager client.  There were a couple of difficult areas:
   
   ### TestOmMetrics class
   
   These tests verify that the correct number of metrics are being generated.  Most of them use mocks invoked by the methods removed in this PR.  So they had to be significantly restructured.  In most cases the mocks had to be replaced with a miniCluster, (because there is no other way to generate the metrics.)
   
   My goal was to fix the tests so the number of metrics would not change.  I was able to do that in all cases except one. One of the tests uses the checkVolumeAccess() method, which was removed months ago, (as mentioned above).  The old mocks were incorrectly ignoring the exception it has been generating. So I removed it from the test and corrected the corresponding counts.  The rest of the counts are unchanged.
   
   ### listStatus() race condition while key is in cache
   Under certain circumstances, listStatus() fails to return a key that is in the cache, (but not in the keyTable).  This race did not occur prior to this PR because the test was using the pre-HA version which doesn't use the cache. 
   
   Since it works when the key is in the table, I fixed the test by retrying until it is read from the table, but it is possible that listStatus() itself should be fixed.  The details of the race are a bit complicated, but explained below.
   
   #### listStatus() race condition details
   
   With the commitKey OmRequest, the key is first written to the keyTableCache and then to the keyTable when the double buffer is flushed.
   
   If the OZONE_OM_ENABLE_FILESYSTEM_PATHS is enabled, and the key looks like a file name, the key's superdirectory's are added to cache during the openKey [OmRequest](https://github.com/apache/ozone/blob/af5b48e4571e74fcad2e4546ff0efe79c3a96350/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCreateRequest.java#L270)
   
   If OZONE_OM_ENABLE_FILESYSTEM_PATHS is not enabled, the superdirectories are not added in the openkey request.  The cache search method in listStatus() is written to skip any keys with an embedded "/" [here](https://github.com/apache/ozone/blob/af5b48e4571e74fcad2e4546ff0efe79c3a96350/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java#L2285)
   
   So, if OZONE_OM_ENABLE_FILESYSTEM_PATHS is disabled, and a key with an embedded "/" is commited, and it is still in the cache, listStatus() won't see it.
   
   listStatus() does return the key when it gets flushed to the table, so sleeping for a bit fixes the problem.
   
   I've only noticed this happening on one test and only 20% of the time.  (I've put a sleep in to handle that case.)  But we should discuss if that is good enough.
   
   ## Genesis Broken in Master
   `ozone genesis -b BenchMarkOzoneManager` uses the pre-HA code and so should also be updated for these changes.  
   
   It is currently broken in the master branch.  It generates this exception when I try to run it in master:
   ```
   org.apache.hadoop.metrics2.MetricsException: Metrics source DBCheckpointMetrics already exists!
   ```
   
   I think that error will need to be fixed before I can update it, so I've left it out of this PR.  Let me know if that's a problem.
   
   Since the CI tests don't run Genesis, the lack of updates don't cause the tests to fail.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-3371
   
   ## How was this patch tested?
   
   All effected tests were updated and all pass without fail.
   
   I timed all the changed tests. Before the changes, they took 12 minutes on average.  Now they take 12.5 minutes on average.
   
   I ran the CI 12 times each on master and on this branch.  master failed 6 of those times, this branch failed 6 of those times.  While there was some overlap in the failures, some were unique to master and some to this branch.
   
   As best I could tell, none of the failures were related to these changes, but it is hard to be sure.
   


-- 
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] bharatviswa504 commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > In commitKey OmRequest, a key is first written to the keyTableCache and then to the keyTable when the double buffer is flushed.
   > 
   > If OZONE_OM_ENABLE_FILESYSTEM_PATHS is enabled, and the key has a superdirectory, thesuperdirectory's are added to cache during the openKey OmRequest
   > 
   > If OZONE_OM_ENABLE_FILESYSTEM_PATHS is not enabled, the superdirectories are not added in the openkey request. In addition, the cache search method in listStatus() is written to skip any keys with an embedded "/" here
   > 
   > So, if OZONE_OM_ENABLE_FILESYSTEM_PATHS is disabled, and a key with an embedded "/" is commited, and it is still in the cache, listStatus() won't see it or it's superdirectory.
   > 
   
   I think if filesystem path is disabled, then it is Object store kind of bucket. On ObjectStore kind of buckets, we donot need to support FS API's like listStatus. And from reading code I think to skip after Stripping "/" at end is as recursive false, We donot need to print 2 level deeper child. As the issue here is for OBS, we donot create intermediate dirs that is the reason this logic of search with the below code is failing to find in cache (As in cache we donot find any intermediate dirs). If we want to fix this for OBS buckets, we should have similar logic getChild like here(https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java#L2411)
   
   Or another way to fix the test is listKeys. Which is an Object Store API.
   
   
   ```
               String remainingKey = StringUtils.stripEnd(cacheKey.substring(
                   startCacheKey.length()), OZONE_URI_DELIMITER);
               // For non-recursive, the remaining part of key can't have '/'
               if (remainingKey.contains(OZONE_URI_DELIMITER)) {
                 continue;
   ```
   
   cc @rakeshadr @smengcl for any comments.
   


-- 
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] GeorgeJahad commented on a change in pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -111,63 +123,54 @@ public void testVolumeOps() throws Exception {
             ozoneManager, "volumeManager");
     VolumeManager mockVm = Mockito.spy(volumeManager);
 
-    Mockito.doNothing().when(mockVm).createVolume(null);
-    Mockito.doNothing().when(mockVm).deleteVolume(null);
-    Mockito.doReturn(null).when(mockVm).getVolumeInfo(null);
-    Mockito.doReturn(true).when(mockVm).checkVolumeAccess(null, null);
-    Mockito.doNothing().when(mockVm).setOwner(null, null);
-    Mockito.doReturn(null).when(mockVm).listVolumes(null, null, null, 0);
-
-    HddsWhiteboxTestUtils.setInternalState(
-        ozoneManager, "volumeManager", mockVm);
-    doVolumeOps();
-
+    OmVolumeArgs volumeArgs = createVolumeArgs();
+    doVolumeOps(volumeArgs);
     MetricsRecordBuilder omMetrics = getMetrics("OMMetrics");
-    assertCounter("NumVolumeOps", 6L, omMetrics);
+    assertCounter("NumVolumeOps", 5L, omMetrics);
     assertCounter("NumVolumeCreates", 1L, omMetrics);

Review comment:
       decreased by 1 because of removal of checkVolumeAccess() op

##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -111,63 +123,54 @@ public void testVolumeOps() throws Exception {
             ozoneManager, "volumeManager");
     VolumeManager mockVm = Mockito.spy(volumeManager);
 
-    Mockito.doNothing().when(mockVm).createVolume(null);
-    Mockito.doNothing().when(mockVm).deleteVolume(null);
-    Mockito.doReturn(null).when(mockVm).getVolumeInfo(null);
-    Mockito.doReturn(true).when(mockVm).checkVolumeAccess(null, null);
-    Mockito.doNothing().when(mockVm).setOwner(null, null);
-    Mockito.doReturn(null).when(mockVm).listVolumes(null, null, null, 0);
-
-    HddsWhiteboxTestUtils.setInternalState(
-        ozoneManager, "volumeManager", mockVm);
-    doVolumeOps();
-
+    OmVolumeArgs volumeArgs = createVolumeArgs();
+    doVolumeOps(volumeArgs);
     MetricsRecordBuilder omMetrics = getMetrics("OMMetrics");
-    assertCounter("NumVolumeOps", 6L, omMetrics);
+    assertCounter("NumVolumeOps", 5L, omMetrics);
     assertCounter("NumVolumeCreates", 1L, omMetrics);
     assertCounter("NumVolumeUpdates", 1L, omMetrics);
     assertCounter("NumVolumeInfos", 1L, omMetrics);
-    assertCounter("NumVolumeCheckAccesses", 1L, omMetrics);
     assertCounter("NumVolumeDeletes", 1L, omMetrics);
     assertCounter("NumVolumeLists", 1L, omMetrics);
     assertCounter("NumVolumes", 1L, omMetrics);
 
-    ozoneManager.createVolume(null);
-    ozoneManager.createVolume(null);
-    ozoneManager.createVolume(null);
-    ozoneManager.deleteVolume(null);
+    volumeArgs = createVolumeArgs();
+    writeClient.createVolume(volumeArgs);
+    volumeArgs = createVolumeArgs();
+    writeClient.createVolume(volumeArgs);
+    volumeArgs = createVolumeArgs();
+    writeClient.createVolume(volumeArgs);
+    writeClient.deleteVolume(volumeArgs.getVolume());
 
     omMetrics = getMetrics("OMMetrics");
 
     // Accounting 's3v' volume which is created by default.
     assertCounter("NumVolumes", 3L, omMetrics);
 
 
-    // inject exception to test for Failure Metrics
-    Mockito.doThrow(exception).when(mockVm).createVolume(null);
-    Mockito.doThrow(exception).when(mockVm).deleteVolume(null);
-    Mockito.doThrow(exception).when(mockVm).getVolumeInfo(null);
-    Mockito.doThrow(exception).when(mockVm).checkVolumeAccess(null, null);
-    Mockito.doThrow(exception).when(mockVm).setOwner(null, null);
-    Mockito.doThrow(exception).when(mockVm).listVolumes(null, null, null, 0);
+    // inject exception to test for Failure Metrics on the read path
+    Mockito.doThrow(exception).when(mockVm).getVolumeInfo(any());
+    Mockito.doThrow(exception).when(mockVm).listVolumes(any(), any(),
+        any(), anyInt());
 
     HddsWhiteboxTestUtils.setInternalState(ozoneManager,
         "volumeManager", mockVm);
-    doVolumeOps();
+    // inject exception to test for Failure Metrics on the write path
+    mockWritePathExceptions(OmVolumeArgs.class);
+    volumeArgs = createVolumeArgs();
+    doVolumeOps(volumeArgs);
 
     omMetrics = getMetrics("OMMetrics");
-    assertCounter("NumVolumeOps", 16L, omMetrics);
+    assertCounter("NumVolumeOps", 14L, omMetrics);

Review comment:
       decreased by 1 because of removal of checkVolumeAccess() op




-- 
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] GeorgeJahad commented on a change in pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -111,63 +123,54 @@ public void testVolumeOps() throws Exception {
             ozoneManager, "volumeManager");
     VolumeManager mockVm = Mockito.spy(volumeManager);
 
-    Mockito.doNothing().when(mockVm).createVolume(null);
-    Mockito.doNothing().when(mockVm).deleteVolume(null);
-    Mockito.doReturn(null).when(mockVm).getVolumeInfo(null);
-    Mockito.doReturn(true).when(mockVm).checkVolumeAccess(null, null);
-    Mockito.doNothing().when(mockVm).setOwner(null, null);
-    Mockito.doReturn(null).when(mockVm).listVolumes(null, null, null, 0);
-
-    HddsWhiteboxTestUtils.setInternalState(
-        ozoneManager, "volumeManager", mockVm);
-    doVolumeOps();
-
+    OmVolumeArgs volumeArgs = createVolumeArgs();
+    doVolumeOps(volumeArgs);
     MetricsRecordBuilder omMetrics = getMetrics("OMMetrics");
-    assertCounter("NumVolumeOps", 6L, omMetrics);
+    assertCounter("NumVolumeOps", 5L, omMetrics);
     assertCounter("NumVolumeCreates", 1L, omMetrics);
     assertCounter("NumVolumeUpdates", 1L, omMetrics);
     assertCounter("NumVolumeInfos", 1L, omMetrics);
-    assertCounter("NumVolumeCheckAccesses", 1L, omMetrics);
     assertCounter("NumVolumeDeletes", 1L, omMetrics);
     assertCounter("NumVolumeLists", 1L, omMetrics);
     assertCounter("NumVolumes", 1L, omMetrics);
 
-    ozoneManager.createVolume(null);
-    ozoneManager.createVolume(null);
-    ozoneManager.createVolume(null);
-    ozoneManager.deleteVolume(null);
+    volumeArgs = createVolumeArgs();
+    writeClient.createVolume(volumeArgs);
+    volumeArgs = createVolumeArgs();
+    writeClient.createVolume(volumeArgs);
+    volumeArgs = createVolumeArgs();
+    writeClient.createVolume(volumeArgs);
+    writeClient.deleteVolume(volumeArgs.getVolume());
 
     omMetrics = getMetrics("OMMetrics");
 
     // Accounting 's3v' volume which is created by default.
     assertCounter("NumVolumes", 3L, omMetrics);
 
 
-    // inject exception to test for Failure Metrics
-    Mockito.doThrow(exception).when(mockVm).createVolume(null);
-    Mockito.doThrow(exception).when(mockVm).deleteVolume(null);
-    Mockito.doThrow(exception).when(mockVm).getVolumeInfo(null);
-    Mockito.doThrow(exception).when(mockVm).checkVolumeAccess(null, null);
-    Mockito.doThrow(exception).when(mockVm).setOwner(null, null);
-    Mockito.doThrow(exception).when(mockVm).listVolumes(null, null, null, 0);
+    // inject exception to test for Failure Metrics on the read path
+    Mockito.doThrow(exception).when(mockVm).getVolumeInfo(any());
+    Mockito.doThrow(exception).when(mockVm).listVolumes(any(), any(),
+        any(), anyInt());
 
     HddsWhiteboxTestUtils.setInternalState(ozoneManager,
         "volumeManager", mockVm);
-    doVolumeOps();
+    // inject exception to test for Failure Metrics on the write path
+    mockWritePathExceptions(OmVolumeArgs.class);
+    volumeArgs = createVolumeArgs();
+    doVolumeOps(volumeArgs);
 
     omMetrics = getMetrics("OMMetrics");
-    assertCounter("NumVolumeOps", 16L, omMetrics);
+    assertCounter("NumVolumeOps", 14L, omMetrics);

Review comment:
       decreased by 2 because of removal of checkVolumeAccess() op




-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   Thank you @bharatviswa504 for the guidance!


-- 
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] GeorgeJahad commented on a change in pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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



##########
File path: hadoop-ozone/integration-test/dev-support/findbugsExcludeFile.xml
##########
@@ -108,6 +108,10 @@
     <Class name="org.apache.hadoop.ozone.om.TestSecureOzoneManager"/>
     <Bug pattern="UWF_NULL_FIELD" />
   </Match>
+  <Match>
+    <Class name="org.apache.hadoop.ozone.om.TestOmMetrics"/>
+    <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />

Review comment:
       Spotbugs reported this about these lines so I added an exemption:
   ```
   M D RV: Return value of OMMetadataManager.getBucketTable() ignored, but method has no side effect  At TestOmMetrics.java:[line 340]
   M D RV: Return value of OMMetadataManager.getVolumeTable() ignored, but method has no side effect  At TestOmMetrics.java:[line 342]
   ```
   




-- 
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] GeorgeJahad edited a comment on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > another way to fix the test is listKeys.
   
   @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is:  testListStatusWithIntermediateDir
   
   so it seems a bit weird not to use listStatus().  If it is not correct to use listStatus() when
   enabledFileSystemPaths is false, maybe the test shouldn't run in that case, and only run when
   enabledFileSystemPaths is true?
   


-- 
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] GeorgeJahad commented on a change in pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -442,64 +453,59 @@ private void testAclMetricsInternal(ObjectStore objectStore, OzoneObj volObj,
   /**
    * Test volume operations with ignoring thrown exception.
    */
-  private void doVolumeOps() {
+  private void doVolumeOps(OmVolumeArgs volumeArgs) {
     try {
-      ozoneManager.createVolume(null);
+      writeClient.createVolume(volumeArgs);
     } catch (IOException ignored) {
     }
 
     try {
-      ozoneManager.deleteVolume(null);
+      ozoneManager.getVolumeInfo(volumeArgs.getVolume());
     } catch (IOException ignored) {
     }
 
     try {
-      ozoneManager.getVolumeInfo(null);
+      writeClient.setOwner(volumeArgs.getVolume(), "dummy");
     } catch (IOException ignored) {
     }
 
     try {
-      ozoneManager.checkVolumeAccess(null, null);
+      ozoneManager.listAllVolumes("", null, 0);
     } catch (IOException ignored) {
     }
 
     try {
-      ozoneManager.setOwner(null, null);
-    } catch (IOException ignored) {
-    }
-
-    try {
-      ozoneManager.listAllVolumes(null, null, 0);
+      writeClient.deleteVolume(volumeArgs.getVolume());
     } catch (IOException ignored) {
     }
   }
 
   /**
    * Test bucket operations with ignoring thrown exception.
    */
-  private void doBucketOps() {
+  private void doBucketOps(OmBucketInfo info) {

Review comment:
       I also restructured this method to match the counts, by moving the delete to the end.  The diffs here make the changes look more significant than they here.  They really look like this:
   |original                |current                 |
   |------------------------|------------------------|
   | createBucket            | createBucket            |
   | deleteBucket            | [moved to end]                        |
   | getBucketInfo           | getBucketInfo           |
   | setBucketProperty                | setBucketProperty                |
   | listBuckets          | listBuckets          |
   |                        |deleteBucket            |
   




-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   @bharatviswa504  and @cxorm here is the updated PR.
   
   Please take a look when you get a chance.
   
   Thanks!


-- 
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] bharatviswa504 edited a comment on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   I merge from github looks it caused CI issue.
   @GeorgeJahad When you get a chance please fix CI checkstyle issue caused with merge. TIA.


-- 
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] bharatviswa504 commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > > another way to fix the test is listKeys.
   > 
   > @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is: testListStatusWithIntermediateDir
   > 
   > so it seems a bit weird not to use listStatus(). If it is not correct to use listStatus() when enabledFileSystemPaths is false, maybe the test shouldn't run in that case, and only run when enabledFileSystemPaths is true?
   
   Yes, the listStatus makes sense when enabledFileSystemPaths to true. As said, if we want to go ahead and fix it, I am even okay with it. cc @rakeshadr for comments.


-- 
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] bharatviswa504 edited a comment on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > > another way to fix the test is listKeys.
   > 
   > @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is: testListStatusWithIntermediateDir
   > 
   > so it seems a bit weird not to use listStatus(). If it is not correct to use listStatus() when enabledFileSystemPaths is false, maybe the test shouldn't run in that case, and only run when enabledFileSystemPaths is true?
   
   Yes, the listStatus makes sense when enabledFileSystemPaths to true. As said, if we want to go ahead and fix it, I am even okay with it (But it does nor add value, once bucket type feature comes in, only FS kind of buckets will access these API's from our interface, unless some one uses direct RpcClient/Java Apis). cc @rakeshadr for comments.


-- 
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] bharatviswa504 commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   I merge from github looks it caused CI issue.
   @GeorgeJahad When you get a chance please fix CI. TIA.


-- 
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] bharatviswa504 commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   Thank You @GeorgeJahad for the improvement.


-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > another way to fix the test is listKeys.
   
   @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is:  testListStatusWithIntermediateDir
   
   so it seems a bit weird not to use listStatus().  If it is not correct to use listStatus() when
   enabledFileSystemPaths is false, maybe the test shouldn't run in that case, and only run when
   enabledFileSystemPaths is true?
   


-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   @bharatviswa504 @rakeshadr Since I don't think I can do anything about the listStatus() problem in this PR, could I just create a separate jira ticket for it, and leave my fix, (the waitFor() call), in the testListStatusWithIntermediateDir() test until that ticket is addressed?
   


-- 
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 #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > @bharatviswa504 @rakeshadr Since I don't think I can do anything about the listStatus() problem in this PR, could I just create a separate jira ticket for it, and leave my fix, (the waitFor() call), in the testListStatusWithIntermediateDir() test until that ticket is addressed?
   
   @GeorgeJahad Please feel free to create a separate task, if you think so. +1.


-- 
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] bharatviswa504 merged pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2703:
URL: https://github.com/apache/ozone/pull/2703


   


-- 
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] GeorgeJahad commented on a change in pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -442,64 +453,59 @@ private void testAclMetricsInternal(ObjectStore objectStore, OzoneObj volObj,
   /**
    * Test volume operations with ignoring thrown exception.
    */
-  private void doVolumeOps() {
+  private void doVolumeOps(OmVolumeArgs volumeArgs) {

Review comment:
       The old mocks enabled this method to be written incorrectly.  The method as written was not aligned with the metrics returned.  The delete happens early in the method and should cause the subsequent calls to fail, but the metrics expected then all to succeed.
   
   
   So I restructured this method to match the counts, by moving the delete to the end.  I also removed the checkVolumeAccess that no longer exists, and added the correct arguments that were previously mocked out.  The diffs here make the changes look more significant than they here.  They really look like this:
   |original                |current                 |
   |------------------------|------------------------|
   |createVolume            |createVolume            |
   |deleteVolume            |[moved to end]                       |
   |getVolumeInfo           |getVolumeInfo           |
   |checkVolumeAccess       |[removed]                       |
   |setOwner                |setOwner                |
   |listAllVolumes          |listAllVolumes          |
   |                        |deleteVolume            |
   
   




-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   @bharatviswa504 @rakeshadr Since I don't think I can do anything about the listStatus() problem in this PR, could I just create a separate jira ticket for it, and leave my fix, (the waitFor() call), in the testListStatusWithIntermediateDir() test until that ticket is addressed?
   


-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > another way to fix the test is listKeys.
   
   I'm ok with using listKeys(), but the name of the test that is failing is:  testListStatusWithIntermediateDir
   
   so it seems a bit weird not to use listStatus().  If it is not correct to use listStatus() when
   enabledFileSystemPaths if false, maybe the test shouldn't run in that case, and only run when
   enabledFileSystemPaths is true?
   


-- 
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] GeorgeJahad commented on a change in pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java
##########
@@ -111,63 +123,54 @@ public void testVolumeOps() throws Exception {
             ozoneManager, "volumeManager");
     VolumeManager mockVm = Mockito.spy(volumeManager);
 
-    Mockito.doNothing().when(mockVm).createVolume(null);
-    Mockito.doNothing().when(mockVm).deleteVolume(null);
-    Mockito.doReturn(null).when(mockVm).getVolumeInfo(null);
-    Mockito.doReturn(true).when(mockVm).checkVolumeAccess(null, null);
-    Mockito.doNothing().when(mockVm).setOwner(null, null);
-    Mockito.doReturn(null).when(mockVm).listVolumes(null, null, null, 0);
-
-    HddsWhiteboxTestUtils.setInternalState(
-        ozoneManager, "volumeManager", mockVm);
-    doVolumeOps();
-
+    OmVolumeArgs volumeArgs = createVolumeArgs();
+    doVolumeOps(volumeArgs);
     MetricsRecordBuilder omMetrics = getMetrics("OMMetrics");
-    assertCounter("NumVolumeOps", 6L, omMetrics);
+    assertCounter("NumVolumeOps", 5L, omMetrics);
     assertCounter("NumVolumeCreates", 1L, omMetrics);
     assertCounter("NumVolumeUpdates", 1L, omMetrics);
     assertCounter("NumVolumeInfos", 1L, omMetrics);
-    assertCounter("NumVolumeCheckAccesses", 1L, omMetrics);
     assertCounter("NumVolumeDeletes", 1L, omMetrics);
     assertCounter("NumVolumeLists", 1L, omMetrics);
     assertCounter("NumVolumes", 1L, omMetrics);
 
-    ozoneManager.createVolume(null);
-    ozoneManager.createVolume(null);
-    ozoneManager.createVolume(null);
-    ozoneManager.deleteVolume(null);
+    volumeArgs = createVolumeArgs();

Review comment:
       In the previous version the mocks would allow the counters would increment, even though the same volume was being created every time. To allow this to work now, I had to create new volumeArgs, each time a new volume was created.




-- 
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] GeorgeJahad edited a comment on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > another way to fix the test is listKeys.
   
   @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is:  testListStatusWithIntermediateDir
   
   so it seems a bit weird not to use listStatus().  If it is not correct to use listStatus() when
   enabledFileSystemPaths if false, maybe the test shouldn't run in that case, and only run when
   enabledFileSystemPaths is true?
   


-- 
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] GeorgeJahad removed a comment on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

Posted by GitBox <gi...@apache.org>.
GeorgeJahad removed a comment on pull request #2703:
URL: https://github.com/apache/ozone/pull/2703#issuecomment-938735344


   > another way to fix the test is listKeys.
   
   @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is:  testListStatusWithIntermediateDir
   
   so it seems a bit weird not to use listStatus().  If it is not correct to use listStatus() when
   enabledFileSystemPaths is false, maybe the test shouldn't run in that case, and only run when
   enabledFileSystemPaths is true?
   


-- 
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] GeorgeJahad commented on pull request #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   @rakeshadr @bharatviswa504 jira ticket here:
   https://issues.apache.org/jira/browse/HDDS-5877
   


-- 
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 #2703: HDDS-3371. Cleanup of old write-path of key in OM

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


   > > > another way to fix the test is listKeys.
   > > 
   > > 
   > > @bharatviswa504 I'm ok with using listKeys(), but the name of the test that is failing is: testListStatusWithIntermediateDir
   > > so it seems a bit weird not to use listStatus(). If it is not correct to use listStatus() when enabledFileSystemPaths is false, maybe the test shouldn't run in that case, and only run when enabledFileSystemPaths is true?
   > 
   > Yes, the listStatus makes sense when enabledFileSystemPaths to true. As said, if we want to go ahead and fix it, I am even okay with it (But it does nor add value, once bucket type feature comes in, only FS kind of buckets will access these API's from our interface, unless some one uses direct RpcClient/Java Apis). cc @rakeshadr for comments.
   
   @bharatviswa504 With BucketLayout feature, Ozone will be able to efficiently manage FILE_SYSTEM_OPTIMIZED("FSO") and OBJECT_STORE("OBS") semantics. Those who need 100% FS semantics user can create FSO bucket and there we/ozone can support all the FS API functionalities. In OBS, FileSystem apis compliance won't be guaranteed anymore. 
   
   Also, IMHO once the bucket layout is fully implemented we can deprecate the `enabledFileSystemPaths` flag.


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