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

View File

@ -275,7 +275,9 @@ void syncBlock(List<BlockRecord> syncList) throws IOException {
}
// 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: