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

Mingliang Liu commented on HDFS-9498:
-------------------------------------

Thanks [~arpitagarwal] for your comment.

Suppose the NN is in manual safe mode, {{blockManager.leaveSafeMode(force)}} 
will not be able to start the secret manager. The reason is that it needs all 
the safe mode is off (manual, resource low and start up safe mode), while 
manual safe mode is still on. 
{code}
  @Override
  public void startSecretManagerIfNecessary() {
    boolean shouldRun = shouldUseDelegationTokens() &&
      !isInSafeMode() && getEditLog().isOpenForWrite();
    boolean running = dtSecretManager.isRunning();
    if (shouldRun && !running) {
      startSecretManager();
    }
  }
{code}
This was not a problem before as we call 
{{setManualAndResourceLowSafeMode(false, false);}} before 
{{blockManager.leaveSafeMode(true);}}.

I thought the {{startSecretManagerIfNecessary();}} is idempotent so it's safe 
do call it again _IfNecessary_.

We may need a better implementation. Ideas are heavily welcome. The goal is 
that NN should not leave safe mode without {{force}} option (either from start 
up safe mode or manual safe mode) in case of orphan blocks.

> Move code that tracks orphan blocks to BlockManagerSafeMode
> -----------------------------------------------------------
>
>                 Key: HDFS-9498
>                 URL: https://issues.apache.org/jira/browse/HDFS-9498
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>            Reporter: Mingliang Liu
>            Assignee: Mingliang Liu
>         Attachments: HDFS-9498.000.patch, HDFS-9498.001.patch, 
> HDFS-9498.002.patch, HDFS-9498.003.patch
>
>
> [HDFS-4015] counts and reports orphaned blocks  
> {{numberOfBytesInFutureBlocks}} in safe mode. It was implemented in 
> {{BlockManager}}. Per discussion in [HDFS-9129] which introduces the 
> {{BlockManagerSafeMode}}, we can move code that maintaining orphaned blocks 
> to this class.



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

Reply via email to