[
https://issues.apache.org/jira/browse/HDFS-8769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14638770#comment-14638770
]
Walter Su commented on HDFS-8769:
---------------------------------
We cannot create a legacy block with updated release.
Assume a user has a lot of legacy blocks with 2.0.x release. The user upgrades
his/her cluster to 2.3.x release. The files exist, the legacy blocks exist,
right?
Assume this user upgrades again the cluster to 3.0.x release. The files exist,
the legacy blocks exist, right?
If a legacy block with id = -1016L was created a few years ago and never got
deleted, and exist in the upgraded cluster. Could you allocate a blockGroup ID
-1016L? Apparently not.
hijack {{SequentialBlockIdGenerator}} is difficult, I have another idea about
how to create a negative legacy block:
{code}
Path file = new Path("/file.txt");
DistributedFileSystem dfs = cluster.getFileSystem();
dfs.create(file, (short) 1); // create an empty file
FSNamesystem ns = cluster.getNamesystem();
FSDirectory fsdir = ns.getFSDirectory();
INodeFile fileNode = fsdir.getINode4Write(file.toString()).asFile();
cluster.getNameNodeRpc().addBlock(file.toString(),
dfs.getClient().getClientName(),
null, null, fileNode.getId(), null);
final BlockInfo lastBlock = fileNode.getLastBlock();
lastBlock.setBlockId(Long.MIN_VALUE);
{code}
Hope It can help you.
> Erasure Coding: unit test for SequentialBlockGroupIdGenerator
> -------------------------------------------------------------
>
> Key: HDFS-8769
> URL: https://issues.apache.org/jira/browse/HDFS-8769
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Walter Su
> Assignee: Rakesh R
> Attachments: HDFS-8769-HDFS-7285-00.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)