[ https://issues.apache.org/jira/browse/HADOOP-19522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17944765#comment-17944765 ]
ASF GitHub Bot commented on HADOOP-19522: ----------------------------------------- bhattmanish98 commented on code in PR #7559: URL: https://github.com/apache/hadoop/pull/7559#discussion_r2044886486 ########## hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/BlobRenameHandler.java: ########## @@ -192,6 +196,13 @@ private boolean finalSrcRename() throws AzureBlobFileSystemException { tracingContext.setOperatedBlobCount(operatedBlobCount.get() + 1); try { return renameInternal(src, dst); + } catch(AbfsRestOperationException e) { + if (e.getStatusCode() == HttpURLConnection.HTTP_CONFLICT) { + // If the destination path already exists, then delete the source path. + getAbfsClient().deleteBlobPath(src, null, tracingContext); Review Comment: During recovery, if a marker is present in the destination directory, the destination etag is not linked to the source directory's etag (as it may or may not be created with source to dest copy operation). Therefore, comparing the source etag and destination etag may return false. Since we are not losing any data here, so I think it is safe to follow this process here. > ABFS: [FnsOverBlob] Rename Recovery Should Succeed When Marker File Exists > with Destination Directory > ----------------------------------------------------------------------------------------------------- > > Key: HADOOP-19522 > URL: https://issues.apache.org/jira/browse/HADOOP-19522 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/azure > Affects Versions: 3.5.0, 3.4.1 > Reporter: Manish Bhatt > Assignee: Manish Bhatt > Priority: Blocker > Labels: pull-request-available > > On the blob endpoint, since rename is not a direct operation but a > combination of two operations—copy and delete—in the case of directory > rename, we first rename all the blobs that have the source prefix and, at the > end, rename the source to the destination. > In the normal rename flow, renaming is not allowed if the destination already > exists. However, in the case of recovery, there is a possibility that some > files have already been renamed from the source to the destination. With the > recent change ([HADOOP-19474] ABFS: [FnsOverBlob] Listing Optimizations to > avoid multiple iteration over list response. - ASF JIRA), where we create a > marker if the path is implicit, rename recovery will fail at the end when it > tries to rename the source to the destination after renaming all the files. > To fix this, while renaming the source to the destination, if we encounter an > error indicating that the path already exists, we will suppress the error and > mark the rename recovery as successful. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org