HDFS-17297. The NameNode should remove block from the BlocksMap if the block is marked as deleted (#6369)
Reviewed-by: ZanderXu <zanderxu@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
This commit is contained in:
parent
fc71dc3e94
commit
3aceec711b
@ -3815,7 +3815,10 @@ boolean internalReleaseLease(Lease lease, String src, INodesInPath iip,
|
||||
// may be client have crashed before writing data to pipeline.
|
||||
// This blocks doesn't need any recovery.
|
||||
// We can remove this block and close the file.
|
||||
pendingFile.removeLastBlock(lastBlock);
|
||||
BlockInfo lastBlockInfo = pendingFile.removeLastBlock(lastBlock);
|
||||
if (lastBlockInfo != null) {
|
||||
blockManager.removeBlock(lastBlockInfo);
|
||||
}
|
||||
finalizeINodeFileUnderConstruction(src, pendingFile,
|
||||
iip.getLatestSnapshotId(), false);
|
||||
if (uc.getNumExpectedLocations() == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user