Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-11287

Storage class member storageDirs should be private to avoid unprotected access by derived classes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 2.9.0, 3.0.0-alpha2
    • Component/s: None
    • Labels:
      None

      Description

      HDFS-11267 fix made the abstract class Storage.java member variable storageDirs a thread safe one so that all its derived classes like NNStorage, JNStorage, DataStorage will not face any ConcurrentModificationException when there are volume add/remove and listing operations running in parallel. The fix rebase missed out few changers to the original patch. This jira is to address the addendum needed for the HDFS-11267 commits.

      1. HDFS-11287.02.patch
        2 kB
        Manoj Govindassamy
      2. HDFS-11287.01.patch
        3 kB
        Manoj Govindassamy

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11140 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11140/)
        HDFS-11287. Storage class member storageDirs should be private to avoid (lei: rev 63320d1daab7ce846bb180623378efe431ad8c52)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java
        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11140 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11140/ ) HDFS-11287 . Storage class member storageDirs should be private to avoid (lei: rev 63320d1daab7ce846bb180623378efe431ad8c52) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
        Hide
        eddyxu Lei (Eddy) Xu added a comment -

        +1. Thanks for working on this, Manoj Govindassamy

        Show
        eddyxu Lei (Eddy) Xu added a comment - +1. Thanks for working on this, Manoj Govindassamy
        Hide
        manojg Manoj Govindassamy added a comment -

        TestWebHdfsTimeouts test failure is not related to the patch.

        Show
        manojg Manoj Govindassamy added a comment - TestWebHdfsTimeouts test failure is not related to the patch.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 16s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 15m 28s trunk passed
        +1 compile 0m 57s trunk passed
        +1 checkstyle 0m 30s trunk passed
        +1 mvnsite 0m 56s trunk passed
        +1 mvneclipse 0m 15s trunk passed
        +1 findbugs 1m 55s trunk passed
        +1 javadoc 0m 49s trunk passed
        +1 mvninstall 0m 52s the patch passed
        +1 compile 0m 58s the patch passed
        +1 javac 0m 58s the patch passed
        +1 checkstyle 0m 29s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 138 unchanged - 1 fixed = 138 total (was 139)
        +1 mvnsite 1m 4s the patch passed
        +1 mvneclipse 0m 12s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 12s the patch passed
        +1 javadoc 0m 44s the patch passed
        -1 unit 73m 15s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 21s The patch does not generate ASF License warnings.
        102m 43s



        Reason Tests
        Failed junit tests hadoop.hdfs.web.TestWebHdfsTimeouts



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HDFS-11287
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12847946/HDFS-11287.02.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 30c2a83a4fff 3.13.0-105-generic #152-Ubuntu SMP Fri Dec 2 15:37:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / e224c96
        Default Java 1.8.0_111
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/18193/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18193/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18193/console
        Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 16s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 15m 28s trunk passed +1 compile 0m 57s trunk passed +1 checkstyle 0m 30s trunk passed +1 mvnsite 0m 56s trunk passed +1 mvneclipse 0m 15s trunk passed +1 findbugs 1m 55s trunk passed +1 javadoc 0m 49s trunk passed +1 mvninstall 0m 52s the patch passed +1 compile 0m 58s the patch passed +1 javac 0m 58s the patch passed +1 checkstyle 0m 29s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 138 unchanged - 1 fixed = 138 total (was 139) +1 mvnsite 1m 4s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 12s the patch passed +1 javadoc 0m 44s the patch passed -1 unit 73m 15s hadoop-hdfs in the patch failed. +1 asflicense 0m 21s The patch does not generate ASF License warnings. 102m 43s Reason Tests Failed junit tests hadoop.hdfs.web.TestWebHdfsTimeouts Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HDFS-11287 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12847946/HDFS-11287.02.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 30c2a83a4fff 3.13.0-105-generic #152-Ubuntu SMP Fri Dec 2 15:37:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / e224c96 Default Java 1.8.0_111 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/18193/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18193/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18193/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        manojg Manoj Govindassamy added a comment -

        Thanks for the review Lei (Eddy) Xu. Sure, and I would also make it a final variable to avoid redefinition in other places. Attached v02 patch incorporating this comment. Kindly take a look.

        Show
        manojg Manoj Govindassamy added a comment - Thanks for the review Lei (Eddy) Xu . Sure, and I would also make it a final variable to avoid redefinition in other places. Attached v02 patch incorporating this comment. Kindly take a look.
        Hide
        eddyxu Lei (Eddy) Xu added a comment -

        Thanks Manoj Govindassamy. The patch looks good to me overall.

        One nit:

        protected List<StorageDirectory> storageDirs =		
            new CopyOnWriteArrayList<>();
        

        We can just change protected to private here, instead of doing new CopyOnWriteArrayList() in two different constructors.

        +1 pending changes.

        Show
        eddyxu Lei (Eddy) Xu added a comment - Thanks Manoj Govindassamy . The patch looks good to me overall. One nit: protected List<StorageDirectory> storageDirs = new CopyOnWriteArrayList<>(); We can just change protected to private here, instead of doing new CopyOnWriteArrayList() in two different constructors. +1 pending changes.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 10s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 14m 7s trunk passed
        +1 compile 0m 52s trunk passed
        +1 checkstyle 0m 29s trunk passed
        +1 mvnsite 1m 2s trunk passed
        +1 mvneclipse 0m 14s trunk passed
        +1 findbugs 1m 58s trunk passed
        +1 javadoc 0m 43s trunk passed
        +1 mvninstall 0m 47s the patch passed
        +1 compile 0m 43s the patch passed
        +1 javac 0m 43s the patch passed
        +1 checkstyle 0m 26s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 138 unchanged - 1 fixed = 138 total (was 139)
        +1 mvnsite 0m 52s the patch passed
        +1 mvneclipse 0m 12s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 5s the patch passed
        +1 javadoc 0m 40s the patch passed
        +1 unit 68m 22s hadoop-hdfs in the patch passed.
        +1 asflicense 0m 19s The patch does not generate ASF License warnings.
        95m 18s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HDFS-11287
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12845442/HDFS-11287.01.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux bef23c53f950 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / ebdd2e0
        Default Java 1.8.0_111
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18012/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18012/console
        Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 10s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 14m 7s trunk passed +1 compile 0m 52s trunk passed +1 checkstyle 0m 29s trunk passed +1 mvnsite 1m 2s trunk passed +1 mvneclipse 0m 14s trunk passed +1 findbugs 1m 58s trunk passed +1 javadoc 0m 43s trunk passed +1 mvninstall 0m 47s the patch passed +1 compile 0m 43s the patch passed +1 javac 0m 43s the patch passed +1 checkstyle 0m 26s hadoop-hdfs-project/hadoop-hdfs: The patch generated 0 new + 138 unchanged - 1 fixed = 138 total (was 139) +1 mvnsite 0m 52s the patch passed +1 mvneclipse 0m 12s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 5s the patch passed +1 javadoc 0m 40s the patch passed +1 unit 68m 22s hadoop-hdfs in the patch passed. +1 asflicense 0m 19s The patch does not generate ASF License warnings. 95m 18s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HDFS-11287 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12845442/HDFS-11287.01.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux bef23c53f950 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / ebdd2e0 Default Java 1.8.0_111 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/18012/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/18012/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        manojg Manoj Govindassamy added a comment -

        Attached v01 patch to address the following

        • Made Storage#storageDirs a private final member
        • BlockPoolSliceStorage and DataStorage now access parent Storage directories via getStorageDirs.
          Lei (Eddy) Xu, can you please take a look at the patch ?
        Show
        manojg Manoj Govindassamy added a comment - Attached v01 patch to address the following Made Storage#storageDirs a private final member BlockPoolSliceStorage and DataStorage now access parent Storage directories via getStorageDirs. Lei (Eddy) Xu , can you please take a look at the patch ?

          People

          • Assignee:
            manojg Manoj Govindassamy
            Reporter:
            manojg Manoj Govindassamy
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development