hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Liang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-12554) Ozone: Fix TestDatanodeStateMachine#testDatanodeStateMachineWithInvalidConfiguration
Date Wed, 27 Sep 2017 19:16:01 GMT

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

Chen Liang commented on HDFS-12554:
-----------------------------------

Looks like the original test expect datanode to shutdown, if datanode.id is set to empty string
"". While in HDFS-12454, it was changed that either datanode.id is not set, or is set to empty
string, the default value will be picked up. More specifically, in {{OzoneUtils#getDatanodeIDPath}},
this check {{Strings.isNullOrEmpty(dataNodeIDPath)}} treats null and empty string the same
way.

To fix this, either:
1. do pick up default when datanode.id is set to empty string. in this case we can remove
from the test the line Xiaoyu mentioned in description
2. do not pick up default if datanode.id is set to empty string. in this case we can just
change that  {{Strings.isNullOrEmpty(dataNodeIDPath)}} check to {{dataNodeIDPath == null}}
and thus only set to default when datanode.id is not set at all. If datanode.id is set to
empty string, {{OzoneUtils#getDatanodeIDPath}} will just return this empty string to caller
and datanode state will transit to shutdown later

I guess #2 makes more sense.

> Ozone: Fix TestDatanodeStateMachine#testDatanodeStateMachineWithInvalidConfiguration
> ------------------------------------------------------------------------------------
>
>                 Key: HDFS-12554
>                 URL: https://issues.apache.org/jira/browse/HDFS-12554
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Xiaoyu Yao
>            Assignee: Ajay Kumar
>              Labels: ozoneMerge
>
> {{hadoop.ozone.container.common.TestDatanodeStateMachine#testDatanodeStateMachineWithInvalidConfiguration}}
failure is related to this patch.
> Invalid ozone.scm.datanode.id like below in the failed test used to prevent datanode
from running and now it is allowed. Please update the unit test and the OzoneGetStarted.md
file correspondingly.
> {code}
>     confList.add(Maps.immutableEntry(
>         ScmConfigKeys.OZONE_SCM_DATANODE_ID, ""));
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message