qijiale76 opened a new pull request, #9026:
URL: https://github.com/apache/hadoop/pull/9026

   ### Description of PR
   
   When SimpleCopyListing traverses a directory created between the two 
snapshots, it excludes the items renamed into it by looking them up with 
diff.getSource(). If an ancestor of the created directory was renamed in the 
same window, as .Trash/Current is by a trash checkpoint, the diff report gives 
the created directory under the old name while the rename targets have the new 
one, so nothing is excluded. A renamed item that was also modified is then 
listed twice and the listing fails with DuplicateFileException.
   
   This patch looks the excluded items up by the path of the created directory 
with the renames applied.
   
   JIRA: https://issues.apache.org/jira/browse/HDFS-18045
   
   ### How was this patch tested?
   
   Added TestDistCpSync#testSyncRenameIntoCreatedDirUnderRenamedParent, which 
reproduces a trash checkpoint. It fails with DuplicateFileException without the 
fix and passes with it. TestDistCpSync, TestDistCpSyncReverseFromSource, 
TestDistCpSyncReverseFromTarget and TestCopyListing pass locally.
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   
   ### AI Tooling
   
   Contains content generated by Claude Code (Claude Opus 5.5).
   
   - [x] The PR includes the phrase "Contains content generated by <tool>" 
where <tool> is the name of the AI tool used.
   - [x] My use of AI contributions follows the ASF legal policy 
https://www.apache.org/legal/generative-tooling.html
   


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