Daryn Sharp created HDFS-4410:
---------------------------------

             Summary: BlockListAsLongs ctors produce corrupt block list
                 Key: HDFS-4410
                 URL: https://issues.apache.org/jira/browse/HDFS-4410
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: namenode
    Affects Versions: 2.0.0-alpha, 0.23.0, 3.0.0
            Reporter: Daryn Sharp


{{BlockListAsLongs()}} and {{BlockListAsLongs(long[])}} produce invalid 
instances.  The former calls the latter with {{BlockListAsLongs(null)}}, which 
is internally short-circuited to create an internal {{blockList}} array that 
does not contain the sentinel delimiting block.  An assert in 
{{getNumberOfBlocks}} will trip, which also prevents the "empty" block list 
from being iterated.

Both ctors are present in the call tree for DN registration and block reports.  
Either those code paths are never executed, or the exceptions are swallowed and 
go unnoticed.  I found it while writing unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to