kerneltime commented on code in PR #7700:
URL: https://github.com/apache/ozone/pull/7700#discussion_r1922046357


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -899,11 +900,26 @@ public String getMultipartKeyFSO(String volume, String 
bucket, String key, Strin
     final long volumeId = getVolumeId(volume);
     final long bucketId = getBucketId(volume,
             bucket);
-    long parentId =
-            OMFileRequest.getParentID(volumeId, bucketId, key, this);
-
-    String fileName = OzoneFSUtils.getFileName(key);
+    long parentId;
+    try {
+      parentId = OMFileRequest.getParentID(volumeId, bucketId, key, this);
+    } catch (final Exception e) {
+      // It is possible we miss directories and exception is thrown.
+      // see https://issues.apache.org/jira/browse/HDDS-11784
+      LOG.warn("Got exception when finding parent id for {}/{}/{}. Use another 
way to get it",

Review Comment:
   This might be a common occurance in a concurrent system and might not 
warrant a `WARN` log. 



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -899,11 +900,26 @@ public String getMultipartKeyFSO(String volume, String 
bucket, String key, Strin
     final long volumeId = getVolumeId(volume);
     final long bucketId = getBucketId(volume,
             bucket);
-    long parentId =
-            OMFileRequest.getParentID(volumeId, bucketId, key, this);
-
-    String fileName = OzoneFSUtils.getFileName(key);
+    long parentId;
+    try {
+      parentId = OMFileRequest.getParentID(volumeId, bucketId, key, this);

Review Comment:
   I am going over the code in a bit more detail but why not use the exception 
handling way to calculate the `parentId` as the default way?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to