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

[GitHub] [ozone] jojochuang opened a new pull request, #4668: HDDS-8545. [hsync] reject renaming open file

jojochuang opened a new pull request, #4668:
URL: https://github.com/apache/ozone/pull/4668

   ## What changes were proposed in this pull request?
   
   Renaming open files is unsupported. It creates unfortunate behavior where inconsistent copies of files appears in the namespace. So let's stop allowing this.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-8545
   
   ## How was this patch tested?
   
   Unit test; Ran HBase integration test to verify it actually function as expected.


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


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

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on code in PR #4668:
URL: https://github.com/apache/ozone/pull/4668#discussion_r1187784456


##########
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:
   Thanks for the review! Updated.



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


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

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #4668:
URL: https://github.com/apache/ozone/pull/4668#issuecomment-1541555426

   Thanks @jojochuang for the patch, @szetszwo for the review.


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


[GitHub] [ozone] adoroszlai merged pull request #4668: HDDS-8545. [hsync] reject renaming open file

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #4668:
URL: https://github.com/apache/ozone/pull/4668


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


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

Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
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