HDFS-8484. Erasure coding: Two contiguous blocks occupy IDs belong to same striped group. Contributed by Walter Su.

This commit is contained in:
Jing Zhao 2015-07-09 14:07:37 -07:00
parent 2470a7bf88
commit e692c7dd92
2 changed files with 15 additions and 10 deletions

View File

@ -338,3 +338,6 @@
HDFS-8563. Erasure Coding: fsck handles file smaller than a full stripe. HDFS-8563. Erasure Coding: fsck handles file smaller than a full stripe.
(Walter Su via jing9) (Walter Su via jing9)
HDFS-8484. Erasure coding: Two contiguous blocks occupy IDs belong to same
striped group. (Walter Su via jing9)

View File

@ -3690,17 +3690,19 @@ public void removeBlock(BlockInfo block) {
} }
public BlockInfo getStoredBlock(Block block) { public BlockInfo getStoredBlock(Block block) {
BlockInfo info = null; if (!BlockIdManager.isStripedBlockID(block.getBlockId())) {
if (BlockIdManager.isStripedBlockID(block.getBlockId())) { return blocksMap.getStoredBlock(block);
info = blocksMap.getStoredBlock(
new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
if ((info == null) && hasNonEcBlockUsingStripedID){
info = blocksMap.getStoredBlock(block);
}
} else {
info = blocksMap.getStoredBlock(block);
} }
return info; if (!hasNonEcBlockUsingStripedID) {
return blocksMap.getStoredBlock(
new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
}
BlockInfo info = blocksMap.getStoredBlock(block);
if (info != null) {
return info;
}
return blocksMap.getStoredBlock(
new Block(BlockIdManager.convertToStripedID(block.getBlockId())));
} }
/** updates a block in under replication queue */ /** updates a block in under replication queue */