[
https://issues.apache.org/jira/browse/HDFS-8459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
cuiyang updated HDFS-8459:
--------------------------
Description:
Why Namenode doesn't judge the status of replicas when convert block status
from commited to complete?
When client finished write block and call namenode::complete(), namenode do
things as follow
(in BlockManager::commitOrCompleteLastBlock):
final boolean b = commitBlock((BlockInfoUnderConstruction)lastBlock,
commitBlock);
if(countNodes(lastBlock).liveReplicas() >= minReplication)
completeBlock(bc, bc.numBlocks()-1, false);
return b;
But the NameNode doesn't care how many replicas which status is finalized
this block has!
It should be this: if there is no one replica which status is not finalized,
the block should not convert to complete status!
Because According to the appendDesign3.pdf
(https://issues.apache.org/jira/secure/attachment/12445209/appendDesign3.pdf):
Complete:
A
complete
block
is
a
block
whose
length
and
GS
are
finalized
and
NameNode
has
seen
a
GS/len
matched
finalized
replica
of
the
block.
was:
Why Namenode doesn't judge the status of replicas when convert block status
from commited to complete?
When client finished write block and call namenode.complete(), namenode do
things as follow(in BlockManager::commitOrCompleteLastBlock):
final boolean b = commitBlock((BlockInfoUnderConstruction)lastBlock,
commitBlock);
if(countNodes(lastBlock).liveReplicas() >= minReplication)
completeBlock(bc, bc.numBlocks()-1, false);
return b;
But it doesn't care how many replicas which status is finalized! Because if
there is no one replica which status is not finalized, the block should not
convert to complete status!
According to the appendDesign3.pdf
(https://issues.apache.org/jira/secure/attachment/12445209/appendDesign3.pdf):
Complete:
A
complete
block
is
a
block
whose
length
and
GS
are
finalized
and
NameNode
has
seen
a
GS/len
matched
finalized
replica
of
the
block.
> Question: Why Namenode doesn't judge the status of replicas when convert
> block status from commited to complete?
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HDFS-8459
> URL: https://issues.apache.org/jira/browse/HDFS-8459
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: cuiyang
>
> Why Namenode doesn't judge the status of replicas when convert block status
> from commited to complete?
> When client finished write block and call namenode::complete(), namenode do
> things as follow
> (in BlockManager::commitOrCompleteLastBlock):
> final boolean b = commitBlock((BlockInfoUnderConstruction)lastBlock,
> commitBlock);
> if(countNodes(lastBlock).liveReplicas() >= minReplication)
> completeBlock(bc, bc.numBlocks()-1, false);
> return b;
>
> But the NameNode doesn't care how many replicas which status is finalized
> this block has!
> It should be this: if there is no one replica which status is not
> finalized, the block should not convert to complete status!
> Because According to the appendDesign3.pdf
> (https://issues.apache.org/jira/secure/attachment/12445209/appendDesign3.pdf):
> Complete:
A
complete
block
is
a
block
whose
length
and
GS
are
> finalized
and
NameNode
has
seen
a
GS/len
matched
finalized
replica
> of
the
block.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)