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

Uma Maheswara Rao G commented on HDFS-1690:
-------------------------------------------

Hi Konstantin,
Thankyou for the comments

{quote}
  I think we can just skip checking the presence of in_use.lock during 
formatting and go directly to setting the lock on that file? The effect will be 
the same. If file does not exist, it will create and lock it.
{quote}
  No. First itself i will check the in_use.lock file presence. After that only 
i am going for other conditions.
  
Above mentioned proposal is:
 1) if in_use.lock not present then we can allow for formatting.

 2) If in_use.lock present, then we need to check for lock. If it is allowing 
to   take lock then we can allow formatting.If it is not allowing to take lock 
then we should not allow for format.


{quote}
So I'd propose to modify StorageDirectory.clearDirectory() to first delete file 
STORAGE_FILE_LOCK=in_use.lock then the rest of it. I see now it's a bug.
{quote}
    But here the problem could be that , As i know in Linux, always i can 
delete the files, no matter other process is using it or not.


One more idea i got,
 i.e, why con't we restrict besed on PID in script file itself ?. 
  It is like, how hadoop start script will restrict to start the process when 
it is already running.




> Name Node should not process format command while it is running.
> ----------------------------------------------------------------
>
>                 Key: HDFS-1690
>                 URL: https://issues.apache.org/jira/browse/HDFS-1690
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>    Affects Versions: 0.20.1, 0.20.2, 0.21.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>         Attachments: HDFS-1690.patch
>
>
> Currently NameNode allows format command while it running. In this case the 
> command is executed partially (Lock file is deleted) and an exception thrown. 
> Because of this Name Node should be formatted after restart. This sort of 
> cases can happen accidentally. To prevent such cases Name Node should not 
> execute the format command partially while it is running. It can stright away 
> throw exception/log saying, Name Node is running.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to