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

Reviewed-by: Ayush Saxena <ayushsaxena@apache.org>
(cherry picked from commit a1b4eebcc9)
This commit is contained in:
Wei-Chiu Chuang 2019-10-24 13:09:52 -07:00 committed by Wei-Chiu Chuang
parent 570ffa1cd6
commit 8cf4bc4bda
1 changed files with 2 additions and 1 deletions

View File

@ -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 {