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

Yongjun Zhang commented on HDFS-9569:
-------------------------------------

Hi [~cnauroth],

Thanks again for your review and comments.

About your suggested change (option 1)
{code}
      } catch (IllegalReservedPathException e) {
        throw e;
{code}

The intention of my last change (option 2) was to include the fsimage file name 
in the exception, the above suggested change won't do it. That's why I did one 
error logging before rethrowing, so the logging has the imageFile name:
{code}
      } catch (IllegalReservedPathException e) {
        LOG.error("Failed to load image from " + imageFile, e);
        throw e;
{code}

Another way to do it is (option 3):
{code}
      } catch (IllegalReservedPathException e) {
          throw new IllegalReservedPathException("Failed to load image from "
              + imageFile + " (" + e.getMessage() +")", e);
        }
        ...
{code}

If we want to have the imageFile name in the exception message, which option 
would you prefer?

Thanks.


> Log the name of the fsimage being loaded for better supportability
> ------------------------------------------------------------------
>
>                 Key: HDFS-9569
>                 URL: https://issues.apache.org/jira/browse/HDFS-9569
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>            Reporter: Yongjun Zhang
>            Assignee: Yongjun Zhang
>            Priority: Trivial
>              Labels: supportability
>             Fix For: 2.7.3
>
>         Attachments: HDFS-9569.001.patch, HDFS-9569.002.patch, 
> HDFS-9569.003.patch
>
>
> When NN starts to load fsimage, it does
> {code}
>  void loadFSImageFile(FSNamesystem target, MetaRecoveryContext recovery,
>       FSImageFile imageFile, StartupOption startupOption) throws IOException {
>       LOG.debug("Planning to load image :\n" + imageFile);
>       ......
>     long txId = loader.getLoadedImageTxId();
>     LOG.info("Loaded image for txid " + txId + " from " + curFile);
> {code}
> A debug msg is issued at the beginning with the fsimage file name, then at 
> the end an info msg is issued after loading.
> If the fsimage loading failed due to corrupted fsimage (see HDFS-9406), we 
> don't see the first msg. It'd be helpful to always be able to see from NN 
> logs what fsimage file it's loading.
> Two improvements:
> 1. Change the above debug to info
> 2. If exception happens when loading fsimage, be sure to report the fsimage 
> name being loaded in the error message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to