You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2023/05/06 18:21:51 UTC

[GitHub] [ozone] szetszwo commented on a diff in pull request #4668: HDDS-8545. [hsync] reject renaming open file

szetszwo commented on code in PR #4668:
URL: https://github.com/apache/ozone/pull/4668#discussion_r1186730122


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRenameRequestWithFSO.java:
##########
@@ -137,12 +138,17 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       OzoneFileStatus fromKeyFileStatus =
               OMFileRequest.getOMKeyInfoIfExists(omMetadataManager, volumeName,
                       bucketName, fromKeyName, 0);
+
       // case-1) fromKeyName should exist, otw throws exception
       if (fromKeyFileStatus == null) {
         // TODO: Add support for renaming open key
         throw new OMException("Key not found " + fromKeyName, KEY_NOT_FOUND);
       }
 
+      if (fromKeyFileStatus.getKeyInfo().isHsync()) {
+        throw new OMException("Open file cannot be renamed", RENAME_OPEN_FILE);

Review Comment:
   Let's mention that it is hsync'ed:
   ```
   throw new OMException("Open file cannot be renamed since it is hsync'ed: volumeName=" + volumeName
                          + ", bucketName=" + bucketName + ", key=" + fromKeyName, RENAME_OPEN_FILE);
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org