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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -899,11 +897,25 @@ 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",
+          volumeId, bucketId, key, e);
+      final String nonFSOMultipartKey =
+          getMultipartKey(volume, bucket, key, uploadId);
+      final OmMultipartKeyInfo multipartKeyInfo =
+          getMultipartInfoTable().get(nonFSOMultipartKey);
+      if (multipartKeyInfo == null) {
+        throw new OMException(MISSING_MULTIPART_KEY_INFO_ERROR);
+      }

Review Comment:
   Let's add a log for this and also use `NO_SUCH_MULTIPART_UPLOAD_ERROR` 
instead since it's already handled in `ObjectEndpoint` (S3G).



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