You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "hemantk-12 (via GitHub)" <gi...@apache.org> on 2023/06/13 21:12:34 UTC

[GitHub] [ozone] hemantk-12 opened a new pull request, #4883: HDDS-8798. Increment NumSnapshotDeleted and NumSnapshotListFails metrics appropriately

hemantk-12 opened a new pull request, #4883:
URL: https://github.com/apache/ozone/pull/4883

   ## What changes were proposed in this pull request?
   Increment `NumSnapshotDeleted` and `NumSnapshotListFails` metrics for success in snapshot deletion and failure in list snapshot requests respectivel. 
   
   ## What is the link to the Apache JIRA
   * https://issues.apache.org/jira/browse/HDDS-8798
   * https://issues.apache.org/jira/browse/HDDS-8799
   
   ## How was this patch tested?
   Updated unit and integration tests to verify the changes.
   


-- 
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] smengcl merged pull request #4883: HDDS-8798. Increment NumSnapshotDeleted and NumSnapshotListFails metrics appropriately

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl merged PR #4883:
URL: https://github.com/apache/ozone/pull/4883


-- 
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] adoroszlai commented on a diff in pull request #4883: HDDS-8798. Increment NumSnapshotDeleted and NumSnapshotListFails metrics appropriately

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #4883:
URL: https://github.com/apache/ozone/pull/4883#discussion_r1230653902


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2831,28 +2830,27 @@ public List<RepeatedOmKeyInfo> listTrash(String volumeName,
   public List<SnapshotInfo> listSnapshot(
       String volumeName, String bucketName, String snapshotPrefix,
       String prevSnapshot, int maxListResult) throws IOException {
-    if (isAclEnabled) {
-      omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
-          ACLType.LIST, volumeName, bucketName, null);
-    }
-    boolean auditSuccess = true;
-    Map<String, String> auditMap = buildAuditMap(volumeName);
-    auditMap.put(OzoneConsts.BUCKET, bucketName);
+    metrics.incNumSnapshotLists();
+    Map<String, String> auditMap = new HashMap<>();
     try {
-      metrics.incNumSnapshotLists();
-      return metadataManager.listSnapshot(volumeName, bucketName,
-          snapshotPrefix, prevSnapshot, maxListResult);
+      if (isAclEnabled) {
+        omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
+            ACLType.LIST, volumeName, bucketName, null);
+      }
+      auditMap = buildAuditMap(volumeName);
+      auditMap.put(OzoneConsts.BUCKET, bucketName);

Review Comment:
   If ACL check rejects the request, audit log will not have volume/bucket names.  Not broken by this change, but I think it can be fixed in the same patch.  Only ACL check should be moved inside the `try` block.



-- 
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] hemantk-12 commented on a diff in pull request #4883: HDDS-8798. Increment NumSnapshotDeleted and NumSnapshotListFails metrics appropriately

Posted by "hemantk-12 (via GitHub)" <gi...@apache.org>.
hemantk-12 commented on code in PR #4883:
URL: https://github.com/apache/ozone/pull/4883#discussion_r1231317923


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2831,28 +2830,27 @@ public List<RepeatedOmKeyInfo> listTrash(String volumeName,
   public List<SnapshotInfo> listSnapshot(
       String volumeName, String bucketName, String snapshotPrefix,
       String prevSnapshot, int maxListResult) throws IOException {
-    if (isAclEnabled) {
-      omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
-          ACLType.LIST, volumeName, bucketName, null);
-    }
-    boolean auditSuccess = true;
-    Map<String, String> auditMap = buildAuditMap(volumeName);
-    auditMap.put(OzoneConsts.BUCKET, bucketName);
+    metrics.incNumSnapshotLists();
+    Map<String, String> auditMap = new HashMap<>();
     try {
-      metrics.incNumSnapshotLists();
-      return metadataManager.listSnapshot(volumeName, bucketName,
-          snapshotPrefix, prevSnapshot, maxListResult);
+      if (isAclEnabled) {
+        omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
+            ACLType.LIST, volumeName, bucketName, null);
+      }
+      auditMap = buildAuditMap(volumeName);
+      auditMap.put(OzoneConsts.BUCKET, bucketName);

Review Comment:
   Fixed it.



-- 
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] smengcl commented on pull request #4883: HDDS-8798. Increment NumSnapshotDeleted and NumSnapshotListFails metrics appropriately

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on PR #4883:
URL: https://github.com/apache/ozone/pull/4883#issuecomment-1594268325

   Thanks @hemantk-12 for the patch. Thanks @adoroszlai for the review.


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