sumitagrawl commented on code in PR #4478:
URL: https://github.com/apache/ozone/pull/4478#discussion_r1156932884


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java:
##########
@@ -430,8 +430,14 @@ private boolean renameFSO(OzoneBucket bucket,
     // construct src and dst key paths
     String srcKeyPath = srcPath.getNonKeyPathNoPrefixDelim() +
         OZONE_URI_DELIMITER + srcPath.getKeyName();
-    String dstKeyPath = dstPath.getNonKeyPathNoPrefixDelim() +
-        OZONE_URI_DELIMITER + dstPath.getKeyName();
+    String dstKeyPath;
+    if (dstPath.isBucket()) {
+      dstKeyPath = dstPath.getNonKeyPathNoPrefixDelim() +
+          OZONE_URI_DELIMITER + srcPath.getFileName();
+    } else {
+      dstKeyPath = dstPath.getNonKeyPathNoPrefixDelim() +
+          OZONE_URI_DELIMITER + dstPath.getKeyName();

Review Comment:
   @dombizita yes, non-FSO can not have destination as empty key for bucket, 
key is present at bucket level. So non-FSO key length can not be "0" size.
   While FSO, rename also simulate mv of file from deep directory to bucket 
level also. So here target keyname size can be "0" and take source filename 
here. So there is a bug in OM that it does not allow target with just bucket, 
and as suggested can remove the check in Rename FSO case.
   



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