You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Wei-Chiu Chuang (Jira)" <ji...@apache.org> on 2021/06/09 02:01:00 UTC

[jira] [Commented] (HDFS-16057) Make sure the order for location in ENTERING_MAINTENANCE state

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

Wei-Chiu Chuang commented on HDFS-16057:
----------------------------------------

compactor --> comparator

> 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: 40m
>  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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org