HDFS-6799. The invalidate method in SimulatedFSDataset failed to remove (invalidate) blocks from the file system. Contributed by Megasthenis Asteris.
@@ -490,9 +490,10 @@ public synchronized void finalizeBlock(ExtendedBlock b) throws IOException {
}
@Override // FsDatasetSpi
- public synchronized void unfinalizeBlock(ExtendedBlock b) {
+ public synchronized void unfinalizeBlock(ExtendedBlock b) throws IOException{
if (isValidRbw(b)) {
- blockMap.remove(b.getLocalBlock());
+ final Map<Block, BInfo> map = getMap(b.getBlockPoolId());
+ map.remove(b.getLocalBlock());
}
}
@@ -633,7 +634,7 @@ public synchronized void invalidate(String bpid, Block[] invalidBlks)
continue;
}
storage.free(bpid, binfo.getNumBytes());
- blockMap.remove(b);
+ map.remove(b);
}
if (error) {
throw new IOException("Invalidate: Missing blocks.");
