HDFS-13663. Should throw exception when incorrect block size is set. Contributed by Shweta.

This commit is contained in:
Xiao Chen 2018-07-12 20:19:14 -07:00
parent 1bc106a738
commit 87eeb26e72
1 changed files with 3 additions and 1 deletions

View File

@ -275,7 +275,9 @@ public class BlockRecoveryWorker {
}
// recover() guarantees syncList will have at least one replica with RWR
// or better state.
assert minLength != Long.MAX_VALUE : "wrong minLength";
if (minLength == Long.MAX_VALUE) {
throw new IOException("Incorrect block size");
}
newBlock.setNumBytes(minLength);
break;
case RUR: