chungen0126 commented on code in PR #11674:
URL: https://github.com/apache/ozone/pull/11674#discussion_r4366548611


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRenameRequest.java:
##########
@@ -76,6 +76,14 @@ public OMRequest preExecute(OzoneManager ozoneManager) 
throws IOException {
         .getRenameKeyRequest();
     Objects.requireNonNull(renameKeyRequest, "renameKeyRequest == null");
 
+    // Checked before Ratis only: preExecute does not run when the request is 
applied. The request was created for the
+    // link-resolved layout, and the OBJECT_STORE request class also serves 
LEGACY, so test the layout itself.
+    if (renameKeyRequest.getRequireFileSystemOptimized() && 
!getBucketLayout().isFileSystemOptimized()) {
+      throw new OMException("Bucket: " + 
renameKeyRequest.getKeyArgs().getBucketName()
+          + " has layout: " + getBucketLayout() + ", but the rename requires "
+          + BucketLayout.FILE_SYSTEM_OPTIMIZED + ".", 
OMException.ResultCodes.NOT_SUPPORTED_OPERATION);
+    }
+

Review Comment:
   I have created 
[HDDS-17382](https://issues.apache.org/jira/browse/HDDS-17382) to track this 
issue.



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