Fix NPE in LazyPersistFileScrubber. Contributed by Inigo Goiri.
(cherry picked from commit 303c8dc9b6
)
This commit is contained in:
parent
b89d59e21e
commit
a20789f299
|
@ -3895,9 +3895,13 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Block b = it.next();
|
Block b = it.next();
|
||||||
BlockInfo blockInfo = blockManager.getStoredBlock(b);
|
BlockInfo blockInfo = blockManager.getStoredBlock(b);
|
||||||
BlockCollection bc = getBlockCollection(blockInfo);
|
if (blockInfo == null) {
|
||||||
if (bc.getStoragePolicyID() == lpPolicy.getId()) {
|
LOG.info("Cannot find block info for block " + b);
|
||||||
filesToDelete.add(bc);
|
} else {
|
||||||
|
BlockCollection bc = getBlockCollection(blockInfo);
|
||||||
|
if (bc.getStoragePolicyID() == lpPolicy.getId()) {
|
||||||
|
filesToDelete.add(bc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue