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

Arpit Agarwal commented on HDFS-9498:
-------------------------------------

Thanks for the clarification [~liuml07].

bq. Suppose the NN is in manual safe mode, blockManager.leaveSafeMode(force) 
will not be able to start the secret manager. 
If safe mode exit fails for any reason then attempting to start the secret 
manager will also fail immediately due to the check you pointed out. Also, the 
only failure case I see in {{leaveSafeMode}} is when there are future blocks.

{{startSecretManagerIfNecessary}} looks like it was intended to be idempotent 
but the synchronization is fishy. The object lock is dropped between sampling 
the {{running}} field and invoking {{startThreads}} which sets it to true. All 
callers currently hold the namesystem write lock so it works out fine though. 
We should file a separate bug to fix the secret manager synchronization or 
remove it and document that the caller should synchronize invocations.

> 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.
> Leaving safe mode checks blocks with future GS in {{FSNamesystem}}. This code 
> can also be moved to {{BlockManagerSafeMode}}.



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

Reply via email to