You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/10/23 19:40:45 UTC
[GitHub] [hadoop] dineshchitlangia commented on a change in pull request
#1670: HDFS-14925. Rename operation should check nest snapshot
dineshchitlangia 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_r338241039
##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirRenameOp.java
##########
@@ -400,6 +408,13 @@ static RenameResult unprotectedRenameTo(FSDirectory fsd,
throw new ParentNotDirectoryException(error);
}
+ if (snapshottableDirs.size() > 0) {
+ if (dstParent.asDirectory().isDescendantOfSnapshotRoot()) {
+ throw new SnapshotException("Failed to rename " + src + " to " + dst +
+ " due to nested snapshottable directory");
+ }
+ }
+
Review comment:
This code snippet is written twice in same class, in different methods. Can we instead carve it into a method to avoid code duplication?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org