[ 
https://issues.apache.org/jira/browse/HDFS-16171?focusedWorklogId=637936&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-637936
 ]

ASF GitHub Bot logged work on HDFS-16171:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Aug/21 10:46
            Start Date: 14/Aug/21 10:46
    Worklog Time Spent: 10m 
      Work Description: aajisaka commented on a change in pull request #3280:
URL: https://github.com/apache/hadoop/pull/3280#discussion_r688914812



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestDecommissioningStatus.java
##########
@@ -307,6 +323,59 @@ public void testDecommissionStatus() throws Exception {
     AdminStatesBaseTest.cleanupFile(fileSys, file2);
   }
 
+  protected void verifyInitialState(FSNamesystem fsn, DatanodeManager dm)
+      throws InterruptedException {
+    dm.getDatanodes().forEach(datanodeDescriptor -> {
+      try {
+        checkDecommissionStatus(datanodeDescriptor, 0, 0, 0);
+      } catch (TimeoutException | InterruptedException e) {
+        throw new AssertionError("Datanode not in good state.", e);
+      }
+    });
+    int c = 0;
+    int totalBlocks;
+    long totalReplicatedBlocks;
+    while (true) {
+      totalBlocks = fsn.getBlockManager().getTotalBlocks();
+      totalReplicatedBlocks = fsn.getBlockManager().getTotalReplicatedBlocks();
+      if (totalBlocks == 4 && totalReplicatedBlocks == 4) {
+        break;
+      } else {
+        if (c == 4) {
+          throw new AssertionError("Unexpected Total blocks " + totalBlocks
+              + " and replicated blocks " + totalReplicatedBlocks);
+        }
+        Thread.sleep(3000);
+      }
+      c++;
+    }

Review comment:
       Make sense to me. Thank you for the explanation. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 637936)
    Time Spent: 1h 40m  (was: 1.5h)

> testDecommissionStatus is flaky (for both TestDecommissioningStatus and 
> TestDecommissioningStatusWithBackoffMonitor)
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-16171
>                 URL: https://issues.apache.org/jira/browse/HDFS-16171
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> testDecommissionStatus keeps failing intermittently.
> {code:java}
> [ERROR] 
> testDecommissionStatus(org.apache.hadoop.hdfs.server.namenode.TestDecommissioningStatusWithBackoffMonitor)
>   Time elapsed: 3.299 s  <<< FAILURE!
> java.lang.AssertionError: Unexpected num under-replicated blocks expected:<4> 
> but was:<3>
>       at org.junit.Assert.fail(Assert.java:89)
>       at org.junit.Assert.failNotEquals(Assert.java:835)
>       at org.junit.Assert.assertEquals(Assert.java:647)
>       at 
> org.apache.hadoop.hdfs.server.namenode.TestDecommissioningStatus.checkDecommissionStatus(TestDecommissioningStatus.java:169)
>       at 
> org.apache.hadoop.hdfs.server.namenode.TestDecommissioningStatusWithBackoffMonitor.testDecommissionStatus(TestDecommissioningStatusWithBackoffMonitor.java:136)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to