[ 
https://issues.apache.org/jira/browse/HDFS-6361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13995783#comment-13995783
 ] 

Brandon Li commented on HDFS-6361:
----------------------------------

So sorry for the late response. Thanks [~yzhangal] and [~cmccabe] for the 
finding the issue and giving the background description.

I agree that we should not treat -2 as a special case. Basically, user can 
configure anything in /etc/passwd or corresponding files on purpose or by 
mistake. For example, on MacOS nobody is -2 and nogroup is -1. On Linux, the 
system converts user id "-3" in /etc/passwd to 4294967295. 

NFS gateway get the uid/gid from a shell command. In the result, the id string 
is from uint32. To handle the id from negative number, we can use Long to parse 
the string and then do Long.getInt() to return the correct value.

{quote}..., whether all consumers of Nfs3Util.getFileAttr() will be happy{quote}
The consumers of Nfs3Util.getFileAttr() should be OK with that since it looks 
up the id by using the name retrieved from HDFS.  Let me know if I 
misunderstood your question.




> TestIdUserGroup.testUserUpdateSetting failed due to out of range nfsnobody Id
> -----------------------------------------------------------------------------
>
>                 Key: HDFS-6361
>                 URL: https://issues.apache.org/jira/browse/HDFS-6361
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: nfs
>    Affects Versions: 2.4.0
>            Reporter: Yongjun Zhang
>            Assignee: Yongjun Zhang
>         Attachments: HDFS-6361.001.patch
>
>
> The following error happens pretty often:
> org.apache.hadoop.nfs.nfs3.TestIdUserGroup.testUserUpdateSetting
> Failing for the past 1 build (Since Unstable#61 )
> Took 0.1 sec.
> add description
> Error Message
> For input string: "4294967294"
> Stacktrace
> java.lang.NumberFormatException: For input string: "4294967294"
>       at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>       at java.lang.Integer.parseInt(Integer.java:495)
>       at java.lang.Integer.valueOf(Integer.java:582)
>       at 
> org.apache.hadoop.nfs.nfs3.IdUserGroup.updateMapInternal(IdUserGroup.java:137)
>       at 
> org.apache.hadoop.nfs.nfs3.IdUserGroup.updateMaps(IdUserGroup.java:188)
>       at org.apache.hadoop.nfs.nfs3.IdUserGroup.<init>(IdUserGroup.java:60)
>       at 
> org.apache.hadoop.nfs.nfs3.TestIdUserGroup.testUserUpdateSetting(TestIdUserGroup.java:71)
> Standard Output
> log4j:WARN No appenders could be found for logger 
> (org.apache.hadoop.nfs.nfs3.IdUserGroup).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
> info.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to