[
https://issues.apache.org/jira/browse/HDFS-1363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konstantin Shvachko updated HDFS-1363:
--------------------------------------
Attachment: appendFileSync.patch
This is a patch for trunk.
- It eliminates the second synchronized section in appendFile().
- I moved all this logic related to generating LocatedBlock inside
startFileInternal(),
- which now can return a LocatedBlock if called from appendFile().
- I reintroduce setBlockTokens() in FSNamesystem, otherwise I could not reuse
getBlockLocation() in BlockManager.
- The patch removes the part of the code responsible for cleaning up replicas
of the last block from respective DataNodeDescriptors. This logic was
introduced in HADOOP-5134 for append-20 in order to avoid replication of blocks
under construction. We do not need this anymore as blocks under-construction
are not replicated in current impl, and getBlockLocations() always returns
expected locations for such blocks, ignoring the triplets.
> startFileInternal should return the last block of the file opened for append
> as an under-construction block
> -----------------------------------------------------------------------------------------------------------
>
> Key: HDFS-1363
> URL: https://issues.apache.org/jira/browse/HDFS-1363
> Project: Hadoop HDFS
> Issue Type: Bug
> Affects Versions: 0.21.0
> Reporter: Konstantin Shvachko
> Fix For: 0.21.1
>
> Attachments: appendFileSync.patch
>
>
> {{FSNamesystem.startFileInternal}} should convert the last block of the file
> opened for append to an under-construction block and return it. This will let
> remove the second synchronized section in {{FSNamesystem.appendFile()}} and
> avoid redundant computations and potential inconsistencies as stated in
> HDFS-1152.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.