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

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

                Author: ASF GitHub Bot
            Created on: 09/Jun/21 02:22
            Start Date: 09/Jun/21 02:22
    Worklog Time Spent: 10m 
      Work Description: tomscut commented on pull request #3084:
URL: https://github.com/apache/hadoop/pull/3084#issuecomment-857320247


   > The fix makes sense to me.
   > 
   > It would be great if the test is written as a unit test for 
DatanodeManager rather than a cluster test.
   
   Thank @jojochuang for your review. I will reference 
TestSortLocatedStripedBlock to make some changes.


-- 
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 608891)
    Time Spent: 50m  (was: 40m)

> Make sure the order for location in ENTERING_MAINTENANCE state
> --------------------------------------------------------------
>
>                 Key: HDFS-16057
>                 URL: https://issues.apache.org/jira/browse/HDFS-16057
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: tomscut
>            Assignee: tomscut
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> 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()
> {code:java}
> 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());
> }
> {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