tomscut opened a new pull request #3084:
URL: https://github.com/apache/hadoop/pull/3084


   JIRA: [HDFS-16057](https://issues.apache.org/jira/browse/HDFS-16057).
   
   We use compactor to sort locations in getBlockLocations(), and the expected 
result is: live -> stale -> entering_maintenance -> decommissioned.
   
   But the networktopology. SortByDistance() will disrupt the order. We should 
also filtered out node in sate  AdminStates.ENTERING_MAINTENANCE before 
networktopology. SortByDistance().
   
   
org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager#sortLocatedBlock()
   `DatanodeInfoWithStorage[] di = lb.getLocations();
   // Move decommissioned/stale datanodes to the bottom
   Arrays.sort(di, comparator);
   
   // Sort nodes by network distance only for located blocks
   int lastActiveIndex = di.length - 1;
   while (lastActiveIndex > 0 && isInactive(di[lastActiveIndex])) {
     --lastActiveIndex;
   }
   int activeLen = lastActiveIndex + 1;
   if(nonDatanodeReader) {
     networktopology.sortByDistanceUsingNetworkLocation(client,
         lb.getLocations(), activeLen, createSecondaryNodeSorter());
   } else {
     networktopology.sortByDistance(client, lb.getLocations(), activeLen,
         createSecondaryNodeSorter());
   }
   `
   
   


-- 
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:
[email protected]



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

Reply via email to