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

Shilun Fan updated HDFS-16377:
------------------------------
          Component/s: datanode
         Hadoop Flags: Reviewed
     Target Version/s: 3.2.4, 3.3.2, 3.4.0
    Affects Version/s: 3.2.4
                       3.3.2
                       3.4.0

> Should CheckNotNull before access FsDatasetSpi
> ----------------------------------------------
>
>                 Key: HDFS-16377
>                 URL: https://issues.apache.org/jira/browse/HDFS-16377
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 3.4.0, 3.3.2, 3.2.4
>            Reporter: Tao Li
>            Assignee: Tao Li
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0, 3.3.2, 3.2.4
>
>         Attachments: image-2021-12-10-19-19-22-957.png, 
> image-2021-12-10-19-20-58-022.png
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> When starting the DN, we found NPE in the staring DN's log, as follows:
> !image-2021-12-10-19-19-22-957.png|width=909,height=126!
> The logs of the upstream DN are as follows:
> !image-2021-12-10-19-20-58-022.png|width=905,height=239!
> This is mainly because *FsDatasetSpi* has not been initialized at the time of 
> access. 
> I noticed that checkNotNull is already done in these two 
> method({*}DataNode#getBlockLocalPathInfo{*} and 
> {*}DataNode#getVolumeInfo{*}). So we should add it to other places(interfaces 
> that clients and other DN can access directly) so that we can add a message 
> when throwing exceptions.
> Therefore, the client and the upstream DN know that FsDatasetSpi has not been 
> initialized, rather than blindly unaware of the specific cause of the NPE.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
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