You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/06/04 14:57:26 UTC

[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #904: HDDS-1637. Fix random test failure TestSCMContainerPlacementRackAware.

xiaoyuyao commented on a change in pull request #904: HDDS-1637. Fix random test failure TestSCMContainerPlacementRackAware.
URL: https://github.com/apache/hadoop/pull/904#discussion_r290342177
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/TestSCMContainerPlacementRackAware.java
 ##########
 @@ -82,7 +82,7 @@ public void setup() {
     when(nodeManager.getNodeStat(anyObject()))
         .thenReturn(new SCMNodeMetric(STORAGE_CAPACITY, 0L, 100L));
     when(nodeManager.getNodeStat(datanodes.get(2)))
-        .thenReturn(new SCMNodeMetric(STORAGE_CAPACITY, 90L, 10L));
+        .thenReturn(new SCMNodeMetric(STORAGE_CAPACITY, 90L, 20L));
 
 Review comment:
   Thanks @ChenSammi  for the patch. I had though about similar test only fix yesterday. 
   
   But this may hide a code bug when we deal with mixed nodes that some have enough space while others don't. If the chooseNodes() keep choosing the nodes without enough capacity for 3 times (default), we end up with failures even though other nodes have enough space. Here are two proposals:
   
   1. Filtering the candidate node list without enough capacity so that the placement algorithm won't need to deal with it.
   
   2. Handle capacity in the placement algorithm by adding the detected node without enough capacity to the exclude node list, so that the algorithm won't choose them in the next round. 
   
   I prefer 1 because it seems a cleaner approach and more efficient than 2. I'm OK with 2 as well if you feel it is easier to adjust the placement algorithm. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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