Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-4949 Centralized cache management in HDFS
  3. HDFS-5520

loading cache path directives from edit log doesn't update nextEntryId

    Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 2.3.0
    • Component/s: namenode
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      Loading cache path directives from edit log doesn't update nextEntryId. We need to update this to avoid reusing directive IDs.

      1. HDFS-5520.004.patch
        5 kB
        Colin Patrick McCabe
      2. HDFS-5520.003.patch
        4 kB
        Colin Patrick McCabe
      3. HDFS-5520.002.patch
        4 kB
        Colin Patrick McCabe

        Activity

        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Hdfs-trunk #1587 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1587/)
        HDFS-5520. loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #1587 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1587/ ) HDFS-5520 . loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #1613 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1613/)
        HDFS-5520. loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #1613 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1613/ ) HDFS-5520 . loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #396 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/396/)
        HDFS-5520. loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #396 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/396/ ) HDFS-5520 . loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #4755 (See https://builds.apache.org/job/Hadoop-trunk-Commit/4755/)
        HDFS-5520. loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #4755 (See https://builds.apache.org/job/Hadoop-trunk-Commit/4755/ ) HDFS-5520 . loading cache path directives from edit log doesnt update nextEntryId (cmccabe) (cmccabe: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1543286 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/CacheManager.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestFsDatasetCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestPathBasedCacheRequests.java
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12614503/HDFS-5520.004.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 2 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/5468//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5468//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12614503/HDFS-5520.004.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 2 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/5468//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5468//console This message is automatically generated.
        Hide
        Chris Nauroth added a comment -

        +1 for the new patch. Thanks again, Colin.

        Show
        Chris Nauroth added a comment - +1 for the new patch. Thanks again, Colin.
        Hide
        Colin Patrick McCabe added a comment -

        that's a good point. Let's just disallow using IDs of Long.MAX_VALUE - 1 and higher.

        Show
        Colin Patrick McCabe added a comment - that's a good point. Let's just disallow using IDs of Long.MAX_VALUE - 1 and higher.
        Hide
        Chris Nauroth added a comment -

        Actually, one thought on this: it's potentially inconsistent with the validation check for running out of IDs inside CacheManager#getNextEntryId. It's possible for Long#MAX_VALUE to be used as an ID and written to the edit log. With this patch, we'd load that ID, apply it, and then set nextEntryId to Long#MAX_VALUE + 1. This would overflow, and then subsequent requests to add a new directive would start using IDs outside the range that getNextEntryId was trying to enforce.

        Do you want to add a check for this? This is one of those things that might never happen in practice, but it's probably easy enough to add the check.

        Show
        Chris Nauroth added a comment - Actually, one thought on this: it's potentially inconsistent with the validation check for running out of IDs inside CacheManager#getNextEntryId . It's possible for Long#MAX_VALUE to be used as an ID and written to the edit log. With this patch, we'd load that ID, apply it, and then set nextEntryId to Long#MAX_VALUE + 1 . This would overflow, and then subsequent requests to add a new directive would start using IDs outside the range that getNextEntryId was trying to enforce. Do you want to add a check for this? This is one of those things that might never happen in practice, but it's probably easy enough to add the check.
        Hide
        Chris Nauroth added a comment -

        +1 for the patch, pending Jenkins. Thanks for fixing this, Colin.

        Show
        Chris Nauroth added a comment - +1 for the patch, pending Jenkins. Thanks for fixing this, Colin.
        Hide
        Colin Patrick McCabe added a comment -

        I mean the bug described in HADOOP-10110, not the patch for that JIRA.

        Show
        Colin Patrick McCabe added a comment - I mean the bug described in HADOOP-10110 , not the patch for that JIRA.
        Hide
        Colin Patrick McCabe added a comment -

        Trunk compilation was broken by HADOOP-10110.

        Show
        Colin Patrick McCabe added a comment - Trunk compilation was broken by HADOOP-10110 .
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12614478/HDFS-5520.003.patch
        against trunk revision .

        -1 patch. Trunk compilation may be broken.

        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5462//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12614478/HDFS-5520.003.patch against trunk revision . -1 patch . Trunk compilation may be broken. Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5462//console This message is automatically generated.
        Hide
        Colin Patrick McCabe added a comment -

        looks like trunk compilation was broken last time. rebased and resubmitted to jenkins.

        Show
        Colin Patrick McCabe added a comment - looks like trunk compilation was broken last time. rebased and resubmitted to jenkins.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12614114/HDFS-5520.002.patch
        against trunk revision .

        -1 patch. Trunk compilation may be broken.

        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5448//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12614114/HDFS-5520.002.patch against trunk revision . -1 patch . Trunk compilation may be broken. Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5448//console This message is automatically generated.

          People

          • Assignee:
            Colin Patrick McCabe
            Reporter:
            Colin Patrick McCabe
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development