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

Ayush Saxena commented on HDFS-13927:
-------------------------------------

Thanx [~ajayydv] for the comment.
 I guess you are talking about checking like dn.isDataNodeUp() .
 If we dig a little inside this method and see how it concludes that whether a 
datanode is up or not we will realize that it even ultimately goes and check 
whether the running state is Connecting (i.e DN is trying to connect to 
namenode) or Running (i.e DN is running properly) both the scenarios means that 
DN is Up and active.Here in our test scenario we intend to check that after 
cluster id mismatch the DN shouldn't get up that is shouldn't reach the running 
state rather after trying to connect due to Cluster ID mismatch it should 
FAIL.That only we checked that has the DN concluded it or not.

Adding the code segments for better reference.
{code:java}
 public boolean isDatanodeUp() {
    for (BPOfferService bp : blockPoolManager.getAllNamenodeThreads()) {
      if (bp.isAlive()) {
        return true;
      }
    }
    return false;
  }
{code}
Moving to bp.isAlive()
{code:java}
  boolean isAlive() {
    for (BPServiceActor actor : bpServices) {
      if (actor.isAlive()) {
        return true;
      }
    }
    return false;
  }
{code}
Checking Alive for all actor.
{code:java}
  boolean isAlive() {
    if (!shouldServiceRun || !bpThread.isAlive()) {
      return false;
    }
    return runningState == BPServiceActor.RunningState.RUNNING
        || runningState == BPServiceActor.RunningState.CONNECTING;
  }
{code}
Here finally it checks the state only.Hope this would clarify the doubt. :)

> TestDataNodeMultipleRegistrations#testDNWithInvalidStorageWithHA
> ----------------------------------------------------------------
>
>                 Key: HDFS-13927
>                 URL: https://issues.apache.org/jira/browse/HDFS-13927
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Minor
>         Attachments: HDFS-13927-01.patch
>
>
> Remove the explicit wait in the test for failed datanode with exact time 
> required for the process to confirm the status.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to