1
0
Преглед на файлове

HDFS-14910. Rename Snapshot with Pre Descendants Fail With IllegalArgumentException. Contributed by Wei-Chiu Chuang. (#1672)

Reviewed-by: Ayush Saxena <ayushsaxena@apache.org>
Wei-Chiu Chuang преди 5 години
родител
ревизия
a1b4eebcc9
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java

+ 2 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java

@@ -841,7 +841,8 @@ public class INodeDirectory extends INodeWithAdditionalFields
       // If the inode has empty diff list and sf is not a
       // DirectorySnapshottableFeature, remove the feature to save heap.
       if (sf.getDiffs().isEmpty() &&
-          !(sf instanceof DirectorySnapshottableFeature)) {
+          !(sf instanceof DirectorySnapshottableFeature) &&
+          getDirectoryWithSnapshotFeature() != null) {
         this.removeFeature(sf);
       }
     } else {