Resolution: Won't Fix
Affects Version/s: 2.4.0
Fix Version/s: None
New blocks scanning will be delayed if old blocks deleted after datanode restart.
1. Write some blocks and wait till all scans over
2. Restart the datanode
3. Delete some of the blocks
4. Write new blocks which are less in size compared to deleted blocks.
BlockPoolSliceScanner#updateBytesToScan(..) updates bytesLeft based on following comparison
But in BlockPoolSliceScanner#assignInitialVerificationTimes() bytesLeft decremented using below comparison
Hence when the old blocks are deleted bytesLeft going negative.
new blocks will not be scanned until it becomes positive again.
So in both places verificationtime should be compared against scanperiod.