zhjwpku commented on a change in pull request #1670: HDFS-14925. Rename
operation should check nest snapshot
URL: https://github.com/apache/hadoop/pull/1670#discussion_r339855025
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestRenameWithSnapshots.java
##########
@@ -1115,7 +1115,41 @@ public void testRenameAndUpdateSnapshottableDirs()
throws Exception {
assertEquals(bar, dirs[0].getFullPath());
assertEquals(fooId, dirs[0].getDirStatus().getFileId());
}
-
+
+ /**
+ * Test rename where src has snapshottable descendant directories and
+ * dst is a descent of a snapshottable directory. Such case will cause
+ * nested snapshot which HDFS currently not fully supported.
+ */
+ @Test
+ public void testRenameWithNestedSnapshottableDirs() throws Exception {
+ final Path sdir1 = new Path("/dir1");
+ final Path sdir2 = new Path("/dir2");
+ final Path foo = new Path(sdir1, "foo");
+ final Path bar = new Path(sdir2, "bar");
+
+ hdfs.mkdirs(foo);
+ hdfs.mkdirs(bar);
+
+ hdfs.allowSnapshot(foo);
+ hdfs.allowSnapshot(sdir2);
+
+ try {
+ hdfs.rename(foo, bar, Rename.OVERWRITE);
+ } catch (IOException e) {
Review comment:
fixed, pls check
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]