[ https://issues.apache.org/jira/browse/HDFS-4667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13749850#comment-13749850 ]
Jing Zhao commented on HDFS-4667: --------------------------------- bq. this is the same effect as traverse all entire snapshottable directory's both versions (from snapshot, to snapshot). Suppose here we created snapshot s0 and s1 under directory D. After creating s0, we create a new directory D/D_new. So when computing the snapshot diff between s0 and s1, after we find that D_new is a newly-created dir after s0, we do not need to traverse D_new any more. In the diff report, we report D_new as created and skip all its sub-items. And if we want to know what files/directories were exactly added under D_new while snapshot s1, we only need to list D/.snapshot/s1/D_new. bq. to be able to get target full path (to check permission and fill DiffEntry with respect to snapshot_to) Yeah, this brings us extra complexity. Looks like in some cases it is even impossible to know the exact full path (e.g., another rename also happens in an ancestor node and there may be no way to know which rename happened first unless we also record DstReference#dstSnapshotId in WithName). Let me spend some more time on this. If we cannot find a way to determine the full path, I think your current solution may be the best way, while using the reference links can act as an extra check to detect Rename among the remaining Deleted entries (and the target of the Rename entries has to be skipped in the report). > Capture renamed files/directories in snapshot diff report > --------------------------------------------------------- > > Key: HDFS-4667 > URL: https://issues.apache.org/jira/browse/HDFS-4667 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: datanode, namenode > Reporter: Jing Zhao > Assignee: Binglin Chang > Attachments: getfullname-snapshot-support.patch, > HDFS-4667.demo.patch, HDFS-4667.v1.patch > > > Currently in the diff report we only show file/dir creation, deletion and > modification. After rename with snapshots is supported, renamed file/dir > should also be captured in the diff report. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira