HDFS-12891. Do not invalidate blocks if toInvalidate is empty. Contributed by Zsolt Venczel.

This commit is contained in:
Wei-Chiu Chuang 2017-12-11 16:42:25 -08:00
parent 5cd1056ad7
commit 55fc2d6485
1 changed files with 5 additions and 3 deletions

View File

@ -293,10 +293,12 @@ class InvalidateBlocks {
getBlocksToInvalidateByLimit(nodeToECBlocks.get(dn),
toInvalidate, numECBlocks, remainingLimit);
}
if (toInvalidate.size() > 0 && getBlockSetsSize(dn) == 0) {
remove(dn);
if (toInvalidate.size() > 0) {
if (getBlockSetsSize(dn) == 0) {
remove(dn);
}
dn.addBlocksToBeInvalidated(toInvalidate);
}
dn.addBlocksToBeInvalidated(toInvalidate);
return toInvalidate;
}