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

Colin Patrick McCabe commented on HDFS-6294:
--------------------------------------------

One reason why this comes up is because of the NFS gateway.  Since the gateway 
keeps files open for about 10 minutes after the last packet arrives from the 
client (by default, at least), there are a lot of times when someone copies a 
file to NFS via the gateway and then moves it.

My approach was just to use inode IDs for all the operations done by a file 
open for write: {{complete}}, {{addBlock}}, {{fsync}},  {{abandonBlock}}, and 
{{getAdditionalDataNodes}}.  In the cases where an inode ID was not being 
passed over the wire, I added one to the protobuf.  This is backwards 
compatible because the new protobuf fields are optional.  If the inode ID is 
not present, we fall back on the old behavior of using the full path instead.

> Use INode IDs to avoid conflicts when a file open for write is renamed
> ----------------------------------------------------------------------
>
>                 Key: HDFS-6294
>                 URL: https://issues.apache.org/jira/browse/HDFS-6294
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 0.20.1
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-6294.001.patch
>
>
> Now that we have a unique INode ID for each INode, clients with files that 
> are open for write can use this unique ID rather than a file path when they 
> are requesting more blocks or closing the open file.  This will avoid 
> conflicts when a file which is open for write is renamed, and another file 
> with that name is created.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to