HDFS-13663. Should throw exception when incorrect block size is set. Contributed by Shweta.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/87eeb26e Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/87eeb26e Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/87eeb26e Branch: refs/heads/HDFS-12943 Commit: 87eeb26e7200fa3be0ca62ebf163985b58ad309e Parents: 1bc106a Author: Xiao Chen <x...@apache.org> Authored: Thu Jul 12 20:19:14 2018 -0700 Committer: Xiao Chen <x...@apache.org> Committed: Thu Jul 12 20:24:11 2018 -0700 ---------------------------------------------------------------------- .../apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/87eeb26e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java index 94835e2..34f6c33 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java @@ -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: --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org