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

Yiqun Lin commented on HDFS-11088:
----------------------------------

Hi [~andrew.wang], I have looked into this. I think this WARN log isn't the 
unnesessary  log. The reason why you see this log is that there is one special 
case that namenode can leave safemode in a force way without input the force 
option from users. The related codes({{BlockManagerSafeMode#activate}}):

{code}
  void activate(long total) {
    assert namesystem.hasWriteLock();
    assert status == BMSafeModeStatus.OFF;

    startTime = monotonicNow();
    setBlockTotal(total);
    if (areThresholdsMet()) {
      leaveSafeMode(true);
    }
    ...
{code}

I think we can pass the param from {{true}} to {{false}} here. In addition, I 
found other twp minors in class {{BlockManagerSafeMode}}. I think we can also 
fix these in this JIRA or file another JIRA to have a fix that anything you 
like.

* One typo in WARN log.
{code}
LOG.warn("The threshold value should't be greater than 1," +
{code}
Here {{should't}} should be {{shouldn't}}.

* The default extension value {{DFS_NAMENODE_SAFEMODE_EXTENSION_DEFAULT}} not 
used here, it just use {{0}}.
{code}
this.extension = conf.getInt(DFS_NAMENODE_SAFEMODE_EXTENSION_KEY, 0);
{code}

Attach a patch with these all fixed. Looking forward to seeing your response, 
[~andrew.wang]. Thanks!

> Quash unnecessary safemode WARN message during NameNode startup
> ---------------------------------------------------------------
>
>                 Key: HDFS-11088
>                 URL: https://issues.apache.org/jira/browse/HDFS-11088
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Andrew Wang
>            Assignee: Yiqun Lin
>            Priority: Trivial
>              Labels: newbie
>
> I tried starting a NameNode on a freshly formatted cluster, and it produced 
> this WARN log:
> {noformat}
> 16/11/01 16:42:44 WARN blockmanagement.BlockManagerSafeMode: forceExit used 
> when normal exist would suffice. Treating force exit as normal safe mode exit.
> {noformat}
> I didn't do any special commands related to safemode, so this log should be 
> quashed.
> I didn't try the branch-2's, but it's likely this issue exists there as well.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to