sokui commented on code in PR #7700:
URL: https://github.com/apache/ozone/pull/7700#discussion_r1922680655
##########
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:
per @ivandika3 's suggestion, we probably need to update the logic of
directory deletions for incomplete MPU so that we can prevent missing parent
directories case happening (or make it in a very low probability):
https://github.com/apache/ozone/pull/7566#issuecomment-2584786432
From high level, I feel if this case happens frequently, it means something
is not right (either at code level or design level). How can a key exist but
its parent directories already got deleted? Thats why I feel it is good to have
this warn log here. Pls let me know your thoughts.
--
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]