You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2019/10/24 23:15:36 UTC

[hadoop] 02/02: HDFS-14910. Rename Snapshot with Pre Descendants Fail With IllegalArgumentException. Contributed by Wei-Chiu Chuang. (#1672)

This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git

commit c6e6d1c6cc75bc3f25dff56bb30ab9a5801e48cd
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Thu Oct 24 13:09:52 2019 -0700

    HDFS-14910. Rename Snapshot with Pre Descendants Fail With IllegalArgumentException. Contributed by Wei-Chiu Chuang. (#1672)
    
    Reviewed-by: Ayush Saxena <ay...@apache.org>
    (cherry picked from commit a1b4eebcc92976a9fb78ad5d3ab70c52cc0a5fa7)
    (cherry picked from commit 8cf4bc4bda5b0d33e42168ed2688396524598ead)
---
 .../java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
index b592c3f..85d5a45 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeDirectory.java
+++ b/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 {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org