[
https://issues.apache.org/jira/browse/HDFS-9519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15049671#comment-15049671
]
Xiao Chen commented on HDFS-9519:
---------------------------------
Thanks [~liuml07] and [~aw] for the comments and sorry for my delayed response.
The {{if (secondary != null)}} is confusing, and should be removed with the
change of HDFS-6348. My bad I didn't catch this redundancy when fixing
HDFS-3059.
The reason of disabling the http server when starting with {{CommandLineOpts}}
is that, after processing it the 2NN will terminate. E.g. when someone runs
{{hdfs secondarynamenode -checkpoint}} the 2nn just start and checkpoint, then
exit. Starting an http server during this is unnecessary - the 2nn webui is for
the daemon anyways. Also, when security is enabled, admin may not have the
credentials to the web server, but they should be allowed to do checkpointing.
My comments in the code seems to be doing more confusion than explanation......
I revised it and attached in patch 1 for review.
re. [~aw]'s questions:
bq. If the secondary namenode isn't actually configured but someone tries to
start the 2nn, what happens?
In this case 2NN is started as a daemon. My comments were bad.
bq. Also, does Checkpoint and Backup have different entry points or is this
used for those too?
AFAICT, 2NN only supports {{-checkpoint}}, {{-format}} and {{-geteditsize}},
with the same entry point. Backup should be done from the NN.
> Some coding improvement in SecondaryNameNode#main
> -------------------------------------------------
>
> Key: HDFS-9519
> URL: https://issues.apache.org/jira/browse/HDFS-9519
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Reporter: Yongjun Zhang
> Assignee: Xiao Chen
> Attachments: HDFS-9519.01.patch
>
>
> Two nits:
> # The checking whether secondary is null is not necessary in the following
> code in SecondaryNameNode.java.
> # The comment in this code seems to imply that "when secondary is not null,
> SNN was stared as a daemon.", and this is not true. Suggest to improve the
> comment to make it clear,
> Assign to Xiao since he worked on HDFS-3059. Thanks Xiao.
> {code}
> if (secondary != null) {
> // The web server is only needed when starting SNN as a daemon,
> // and not needed if called from shell command. Starting the web
> server
> // from shell may fail when getting credentials, if the environment
> // is not set up for it, which is most of the case.
> secondary.startInfoServer();
> secondary.startCheckpointThread();
> secondary.join();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)