neils-dev commented on code in PR #4405:
URL: https://github.com/apache/ozone/pull/4405#discussion_r1155397974


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java:
##########
@@ -69,9 +71,24 @@ public static BucketLayout 
resolveLinkBucketLayout(OzoneBucket bucket,
             DETECTED_LOOP_IN_BUCKET_LINKS);
       }
 
-      OzoneBucket sourceBucket =
-          objectStore.getVolume(bucket.getSourceVolume())
-              .getBucket(bucket.getSourceBucket());
+      OzoneBucket sourceBucket;
+      try {
+        sourceBucket =
+            objectStore.getVolume(bucket.getSourceVolume())
+                .getBucket(bucket.getSourceBucket());
+      } catch (OMException ex) {
+        if (ex.getResult().equals(VOLUME_NOT_FOUND)
+            || ex.getResult().equals(BUCKET_NOT_FOUND)) {
+          // for orphan link bucket, return layout as link bucket
+          bucket.setSourcePathExist(false);
+          LOG.error("Source Bucket is not found, its orphan bucket and " +
+              "used link bucket {} layout {}", bucket.getName(),
+              bucket.getBucketLayout());
+          return bucket.getBucketLayout();

Review Comment:
   What is the layout of the linked bucket?  Is it the layout of the original 
source bucket or is it defaulted to some value?



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