File and directory movements with ordered snapshot deletion
When ordered deletion of HDFS snapshots is enabled, you cannot move files and directories present within a snapshottable directory to another similar directory. You can only move them either to other directories present within the same snapshottable directory or directly under the snapshottable directory.
The restriction in the movement of files and directories beyond a snapshottable directory prevents the possibility of complications such as the files or directories belonging to a snapshottable directory moving to a different directory but the related snapshots being deleted from the original snapshottable directory.
Example
Consider the example of a snapshottable directory /dir1
, which
contains a directory /subdir1
; which, in turn, contains a file
file1
. Consider another snapshottable directory
/dir2
that is at the same hierarchy in the filesystem as
/dir1
. When the ordered deletion of snapshots is enabled, you
cannot move file1
under /dir2
because
/dir2
and /dir1
have different directory
paths. However, you can move file1
directly under
/dir1
because the snapshottable root directory does not change
(/dir1
) despite the change in the path of the file.