[
https://issues.apache.org/jira/browse/HDFS-7056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konstantin Shvachko updated HDFS-7056:
--------------------------------------
Attachment: HDFS-7056-13.patch
Here is what we did in the new patch.
- Jing it was very good catch with persisting snapshot blocks into fsimage. My
fault. I thought it was covered by our tests, because we have a bunch of
restarts, but it turned out restart does not save the image as it used before.
New patch persists snapshot blocks and adds a test case, which explicitly saves
namespace before restarting.
- Also bumped up the NameNode layout version.
- Added optimized {{findLaterSnapshotBlocks()}}
- Did the renames requested by Colin.
- Added default value for the newBlockId field.
-- This actually raised a question for me how it will work with rolling
upgrades. Thinking about it.
- Colin, I did not introduce enum as the return value. I would have if there
were three or more values or a potential to have more. But its exactly two. You
are right we cannot change {{recoverLease()}} now. So it is better to have the
same pattern in {{truncate()}} to avoid even more confusion why this is done
differently in two cases.
Anyways we clearly disagree, so it would be good if anybody esle could weigh on
the subject.
> Snapshot support for truncate
> -----------------------------
>
> Key: HDFS-7056
> URL: https://issues.apache.org/jira/browse/HDFS-7056
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode
> Affects Versions: 3.0.0
> Reporter: Konstantin Shvachko
> Assignee: Plamen Jeliazkov
> Attachments: HDFS-3107-HDFS-7056-combined.patch,
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch,
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch,
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch,
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch,
> HDFS-7056-13.patch, HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch,
> HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch,
> HDFS-7056.patch, HDFSSnapshotWithTruncateDesign.docx
>
>
> Implementation of truncate in HDFS-3107 does not allow truncating files which
> are in a snapshot. It is desirable to be able to truncate and still keep the
> old file state of the file in the snapshot.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)