[ 
https://issues.apache.org/jira/browse/HDFS-12832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konstantin Shvachko updated HDFS-12832:
---------------------------------------
       Resolution: Fixed
     Hadoop Flags: Reviewed
    Fix Version/s: 2.8.4
                   3.0.1
                   2.9.1
                   2.10.0
                   3.1.0
                   2.7.5
           Status: Resolved  (was: Patch Available)

Just committed to the following branches:
{code}
   5c37a0b..9d406e5  branch-2 -> branch-2
   0da13b9..7252e18  branch-2.7 -> branch-2.7
   2976d04..3219b1b  branch-2.8 -> branch-2.8
   83c4075..3f9f005  branch-2.9 -> branch-2.9
   a4f1e30..4cbd5ea  branch-3.0 -> branch-3.0
   30941d9..d331762  trunk -> trunk
{code}
LMK if I missed any. Thanks everybody for reviews and comments.

> INode.getFullPathName may throw ArrayIndexOutOfBoundsException lead to 
> NameNode exit
> ------------------------------------------------------------------------------------
>
>                 Key: HDFS-12832
>                 URL: https://issues.apache.org/jira/browse/HDFS-12832
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.7.4, 3.0.0-beta1
>            Reporter: DENG FEI
>            Assignee: Konstantin Shvachko
>            Priority: Critical
>              Labels: release-blocker
>             Fix For: 2.7.5, 3.1.0, 2.10.0, 2.9.1, 3.0.1, 2.8.4
>
>         Attachments: HDFS-12832-branch-2.002.patch, 
> HDFS-12832-branch-2.7.002.patch, HDFS-12832-trunk-001.patch, 
> HDFS-12832.002.patch, exception.log
>
>
> {code:title=INode.java|borderStyle=solid}
> public String getFullPathName() {
>     // Get the full path name of this inode.
>     if (isRoot()) {
>       return Path.SEPARATOR;
>     }
>     // compute size of needed bytes for the path
>     int idx = 0;
>     for (INode inode = this; inode != null; inode = inode.getParent()) {
>       // add component + delimiter (if not tail component)
>       idx += inode.getLocalNameBytes().length + (inode != this ? 1 : 0);
>     }
>     byte[] path = new byte[idx];
>     for (INode inode = this; inode != null; inode = inode.getParent()) {
>       if (inode != this) {
>         path[--idx] = Path.SEPARATOR_CHAR;
>       }
>       byte[] name = inode.getLocalNameBytes();
>       idx -= name.length;
>       System.arraycopy(name, 0, path, idx, name.length);
>     }
>     return DFSUtil.bytes2String(path);
>   }
> {code}
> We found ArrayIndexOutOfBoundsException at 
> _{color:#707070}System.arraycopy(name, 0, path, idx, name.length){color}_ 
> when ReplicaMonitor work ,and the NameNode will quit.
> It seems the two loop is not synchronized, the path's length is changed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to