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

Yiqun Lin commented on HDFS-11112:
----------------------------------

Hi [~jojochuang], there are some comments from me:
{quote}
if current/VERSION is missing, it will start with no problem like nothing has 
happened. No auto-format. But when NN tries to send edits to the JN, the JN 
will respond with JournalNotFormattedException.
{quote}
Can I understand this as that we should start JN failed if current/VERSION is 
missing and avoid the other exceptions that will be threw in the subsequent 
operations? I haven't tested for this special case and I think this should not 
be the situation that addressed in the patch of this JIRA. If this is  a 
problem, one way we can to do a additional "empty check" similar HDFS-10360. 
Now the method {{JNStorage.analyzeAndRecoverStorage}} doesn't do the check for 
current/VERSION file.

{quote}
Do you know the behavior of JN after your patch? Does JN simply ignores format? 
Does JN continues to function normally?
{quote}
My patch makes JN  format failed if there is already storage directories. I'm 
sure It will ignores the format operations since it will throws the exception 
and terminate the subsequent  format operations.

Correct me if I am wrong.Thanks.

> Journal Nodes should refuse to format non-empty directories
> -----------------------------------------------------------
>
>                 Key: HDFS-11112
>                 URL: https://issues.apache.org/jira/browse/HDFS-11112
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Arpit Agarwal
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11112.001.patch, HDFS-11112.002.patch
>
>
> Journal Nodes should reject the {{format}} RPC request if a storage directory 
> is non-empty. The relevant code is in {{JNStorage#format}}.
> {code}
>   void format(NamespaceInfo nsInfo) throws IOException {
>     setStorageInfo(nsInfo);
> ...
>     unlockAll();
>     sd.clearDirectory();
>     writeProperties(sd);
>     createPaxosDir();
>     analyzeStorage();
> {code}
> This would make the behavior similar to {{namenode -format -nonInteractive}}.



--
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