hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei-Chiu Chuang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-13155) BlockPlacementPolicyDefault.chooseTargetInOrder Not Checking Return Value for NULL
Date Mon, 04 Jun 2018 14:06:00 GMT

     [ https://issues.apache.org/jira/browse/HDFS-13155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Wei-Chiu Chuang updated HDFS-13155:
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.4
                   3.1.1
                   3.2.0
           Status: Resolved  (was: Patch Available)

Thanks [~belugabehr], [~zvenczel] and [~gabor.bota] for filing the jira, proposing the fix
and review!

> BlockPlacementPolicyDefault.chooseTargetInOrder Not Checking Return Value for NULL
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-13155
>                 URL: https://issues.apache.org/jira/browse/HDFS-13155
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 3.0.0
>            Reporter: BELUGA BEHR
>            Assignee: Zsolt Venczel
>            Priority: Minor
>             Fix For: 3.2.0, 3.1.1, 3.0.4
>
>         Attachments: HDFS-13155.01.patch, HDFS-13155.02.patch
>
>
> {code:title=BlockPlacementPolicyDefault.java}
> protected Node chooseTargetInOrder(int numOfReplicas, 
>                                  Node writer,
>                                  final Set<Node> excludedNodes,
>                                  final long blocksize,
>                                  final int maxNodesPerRack,
>                                  final List<DatanodeStorageInfo> results,
>                                  final boolean avoidStaleNodes,
>                                  final boolean newBlock,
>                                  EnumMap<StorageType, Integer> storageTypes)
>                                  throws NotEnoughReplicasException {
>     final int numOfResults = results.size();
>     if (numOfResults == 0) {
>       writer = chooseLocalStorage(writer, excludedNodes, blocksize,
>           maxNodesPerRack, results, avoidStaleNodes, storageTypes, true)
>           .getDatanodeDescriptor();
>       if (--numOfReplicas == 0) {
>         return writer;
>       }
>     }
> ...
> {code}
> The method {{chooseLocalStorage}} can return a _null_ value but it's not being checked
here and the method {{getDatanodeDescriptor()}} is immediately being called on the result.
 Please check for a _null_ value first.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message