[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14964218#comment-14964218 ] Andrew Wang commented on HDFS-9250: --- LGTM, thanks Xiao. I'll update the summary and commit this. > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch, HDFS-9250.002.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14961728#comment-14961728 ] Hadoop QA commented on HDFS-9250: - \\ \\ | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:red}-1{color} | pre-patch | 26m 5s | Pre-patch trunk has 1 extant Findbugs (version 3.0.0) warnings. | | {color:green}+1{color} | @author | 0m 0s | The patch does not contain any @author tags. | | {color:green}+1{color} | tests included | 0m 0s | The patch appears to include 1 new or modified test files. | | {color:green}+1{color} | javac | 9m 25s | There were no new javac warning messages. | | {color:green}+1{color} | javadoc | 10m 52s | There were no new javadoc warning messages. | | {color:green}+1{color} | release audit | 0m 26s | The applied patch does not increase the total number of release audit warnings. | | {color:green}+1{color} | checkstyle | 3m 9s | There were no new checkstyle issues. | | {color:green}+1{color} | whitespace | 0m 0s | The patch has no lines that end in whitespace. | | {color:green}+1{color} | install | 1m 31s | mvn install still works. | | {color:green}+1{color} | eclipse:eclipse | 0m 36s | The patch built with eclipse:eclipse. | | {color:green}+1{color} | findbugs | 4m 38s | The patch does not introduce any new Findbugs (version 3.0.0) warnings. | | {color:green}+1{color} | native | 3m 18s | Pre-build of native portion | | {color:red}-1{color} | hdfs tests | 50m 24s | Tests failed in hadoop-hdfs. | | {color:green}+1{color} | hdfs tests | 0m 30s | Tests passed in hadoop-hdfs-client. | | | | 111m 0s | | \\ \\ || Reason || Tests || | Failed unit tests | hadoop.hdfs.server.blockmanagement.TestBlockManager | | | hadoop.hdfs.TestRenameWhileOpen | \\ \\ || Subsystem || Report/Notes || | Patch URL | http://issues.apache.org/jira/secure/attachment/12767182/HDFS-9250.002.patch | | Optional Tests | javadoc javac unit findbugs checkstyle | | git revision | trunk / 58590fe | | Pre-patch Findbugs warnings | https://builds.apache.org/job/PreCommit-HDFS-Build/13035/artifact/patchprocess/trunkFindbugsWarningshadoop-hdfs.html | | hadoop-hdfs test log | https://builds.apache.org/job/PreCommit-HDFS-Build/13035/artifact/patchprocess/testrun_hadoop-hdfs.txt | | hadoop-hdfs-client test log | https://builds.apache.org/job/PreCommit-HDFS-Build/13035/artifact/patchprocess/testrun_hadoop-hdfs-client.txt | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/13035/testReport/ | | Java | 1.7.0_55 | | uname | Linux asf903.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | | Console output | https://builds.apache.org/job/PreCommit-HDFS-Build/13035/console | This message was automatically generated. > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch, HDFS-9250.002.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14961646#comment-14961646 ] Xiao Chen commented on HDFS-9250: - Hey [~andrew.wang], Thanks again for bringing up HDFS-8646, which looks complete to me. The version I encountered the {{ArrayStoreException}} is before your fix. Thus I think it's possible that the location is added without disk replica. Patch 002 is attached. Your suggestion of adding a precondition check sounds great, since otherwise we know it's gonna throw the {{ArrayStoreException}} for sure in that condition. I left the test case untouched just to run into the precondition block. Please review. Thanks! > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch, HDFS-9250.002.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960039#comment-14960039 ] Andrew Wang commented on HDFS-9250: --- It may also be good to add a Precondition check somewhere in addCachedLoc so we can more easily debug this in the future, and as a form of documentation about this assumption. > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960038#comment-14960038 ] Andrew Wang commented on HDFS-9250: --- Hi Xiao, thanks for working on this, So one question about this, we're not supposed to add cached locations that do not also have a backing disk replica. So in your test case, {{dn}} would be present in locs already. If I edit your test case to do this, it passes without the change. This is probably related to HDFS-8646 which I worked on before, we missed some places where cache state could get out of sync with replica state. I thought I added enough pruning to safeguard against this, but maybe I missed a place. Could you investigate? > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14960044#comment-14960044 ] Xiao Chen commented on HDFS-9250: - Hi Andrew, thanks for the comments and additional information. I will further investigate it. > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14959561#comment-14959561 ] Hadoop QA commented on HDFS-9250: - \\ \\ | (x) *{color:red}-1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:red}-1{color} | pre-patch | 20m 24s | Pre-patch trunk has 1 extant Findbugs (version 3.0.0) warnings. | | {color:green}+1{color} | @author | 0m 0s | The patch does not contain any @author tags. | | {color:green}+1{color} | tests included | 0m 0s | The patch appears to include 1 new or modified test files. | | {color:green}+1{color} | javac | 8m 3s | There were no new javac warning messages. | | {color:green}+1{color} | javadoc | 10m 27s | There were no new javadoc warning messages. | | {color:green}+1{color} | release audit | 0m 25s | The applied patch does not increase the total number of release audit warnings. | | {color:green}+1{color} | checkstyle | 2m 57s | There were no new checkstyle issues. | | {color:green}+1{color} | whitespace | 0m 0s | The patch has no lines that end in whitespace. | | {color:green}+1{color} | install | 1m 31s | mvn install still works. | | {color:green}+1{color} | eclipse:eclipse | 0m 36s | The patch built with eclipse:eclipse. | | {color:green}+1{color} | findbugs | 4m 36s | The patch does not introduce any new Findbugs (version 3.0.0) warnings. | | {color:green}+1{color} | native | 3m 15s | Pre-build of native portion | | {color:red}-1{color} | hdfs tests | 50m 26s | Tests failed in hadoop-hdfs. | | {color:green}+1{color} | hdfs tests | 0m 32s | Tests passed in hadoop-hdfs-client. | | | | 103m 17s | | \\ \\ || Reason || Tests || | Failed unit tests | hadoop.hdfs.TestBlockStoragePolicy | \\ \\ || Subsystem || Report/Notes || | Patch URL | http://issues.apache.org/jira/secure/attachment/12766835/HDFS-9250.001.patch | | Optional Tests | javadoc javac unit findbugs checkstyle | | git revision | trunk / 8d2d3eb | | Pre-patch Findbugs warnings | https://builds.apache.org/job/PreCommit-HDFS-Build/13006/artifact/patchprocess/trunkFindbugsWarningshadoop-hdfs.html | | hadoop-hdfs test log | https://builds.apache.org/job/PreCommit-HDFS-Build/13006/artifact/patchprocess/testrun_hadoop-hdfs.txt | | hadoop-hdfs-client test log | https://builds.apache.org/job/PreCommit-HDFS-Build/13006/artifact/patchprocess/testrun_hadoop-hdfs-client.txt | | Test Results | https://builds.apache.org/job/PreCommit-HDFS-Build/13006/testReport/ | | Java | 1.7.0_55 | | uname | Linux asf903.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | | Console output | https://builds.apache.org/job/PreCommit-HDFS-Build/13006/console | This message was automatically generated. > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HDFS-9250) LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty
[ https://issues.apache.org/jira/browse/HDFS-9250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14959574#comment-14959574 ] Xiao Chen commented on HDFS-9250: - The Findbugs warning and test failure are not relevant. Please review. Thanks. > LocatedBlock#addCachedLoc may throw ArrayStoreException when cache is empty > --- > > Key: HDFS-9250 > URL: https://issues.apache.org/jira/browse/HDFS-9250 > Project: Hadoop HDFS > Issue Type: Bug > Components: HDFS >Reporter: Xiao Chen >Assignee: Xiao Chen > Attachments: HDFS-9250.001.patch > > > We may see the following exception: > {noformat} > java.lang.ArrayStoreException > at java.util.ArrayList.toArray(ArrayList.java:389) > at > org.apache.hadoop.hdfs.protocol.LocatedBlock.addCachedLoc(LocatedBlock.java:205) > at > org.apache.hadoop.hdfs.server.namenode.CacheManager.setCachedLocations(CacheManager.java:907) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1974) > at > org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1873) > {noformat} > The cause is that in LocatedBlock.java, when {{addCachedLoc}}: > - Passed in parameter {{loc}}, which is type {{DatanodeDescriptor}}, is added > to {{cachedList}} > - {{cachedList}} was assigned to {{EMPTY_LOCS}}, which is type > {{DatanodeInfoWithStorage}}. > Both {{DatanodeDescriptor}} and {{DatanodeInfoWithStorage}} are subclasses of > {{DatanodeInfo}} but do not inherit from each other, resulting in the > ArrayStoreException. -- This message was sent by Atlassian JIRA (v6.3.4#6332)