Description
In BlockManagerSafeMode class, the "safe blocks" counter is incremented if the number of nodes containing the block equals to the number of data units specified by the erasure coding policy, which looks like this in the code:
final int safe = storedBlock.isStriped() ? ((BlockInfoStriped)storedBlock).getRealDataBlockNum() : safeReplication; if (storageNum == safe) { this.blockSafe++;
But when it is decremented the code does not check if the block is striped or not, just compares the number of nodes containing the block with 0 (safeReplication - 1) if the block is complete, which is not correct.
if (storedBlock.isComplete() && blockManager.countNodes(b).liveReplicas() == safeReplication - 1) { this.blockSafe--; assert blockSafe >= 0; checkSafeMode(); }