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

[GitHub] [ozone] hemantk-12 commented on a diff in pull request #5253: HDDS-9136. Throw exception when rename fails during moveToTrash.

hemantk-12 commented on code in PR #5253:
URL: https://github.com/apache/ozone/pull/5253#discussion_r1318961720


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java:
##########
@@ -350,7 +350,19 @@ boolean processKey(List<String> keyList) throws IOException {
       // TODO RenameKey needs to be changed to batch operation
       for (String key : keyList) {
         String newKeyName = dstKey.concat(key.substring(srcKey.length()));
-        adapter.renameKey(key, newKeyName);
+        try {
+          adapter.renameKey(key, newKeyName);
+        } catch (OMException ome) {
+          LOG.error("rename key failed: {}. source:{}, destin:{}",

Review Comment:
   nit: I think the log message can be better.
   ```
   LOG.error("Key rename failed for source key: {} to " +
           "destination key: {}.", key, newKeyName, ome);
   ``` 
   or:
   ```
   LOG.error("Key rename failed with error: {}. Source key: {}, " +
           "Destination key: {}", ome.getMessage(), key, newKeyName);
   ```
   
   Same for https://github.com/apache/ozone/pull/5253/files#diff-b2802792bb08b569714c90f10ecda42d917dd6329137188472010d2ea7476b1bR344



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