hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpit Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11112) Journal Nodes should refuse to format non-empty directories
Date Tue, 08 Nov 2016 20:50:58 GMT

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

Arpit Agarwal commented on HDFS-11112:
--------------------------------------

Thank you for taking this up [~linyiqun]. Couple of nitpicks with the patch:
# This comment can be removed. Since we call unlockAll() and analyzeStorage(), it follows
that we expect the storage can be non-empty and locked.
{code}
    // Unlock the directory since the storage maybe not empty and
    // locked before formatting sometimes.
{code}
# We should wrap the _sd.analyzeStorage(StartupOption.FORMAT, this, true);_ call in try-finally
and release the lock in the finally block, so we don't return with the lock held if analyze
failed.

This change may be incompatible as there is a good chance of breaking someone's test setup.
I'd commit it to trunk only, just to be safe.

> 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
>
>
> 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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message