This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 4507c2f HDFS-12487. FsDatasetSpi.isValidBlock() lacks null pointer
check inside and neither do the callers. Contributed by liumi.
4507c2f is described below
commit 4507c2f3a5d1447f5e696b14d60191802ebebaed
Author: Wei-Chiu Chuang <[email protected]>
AuthorDate: Fri Jun 21 18:17:36 2019 -0700
HDFS-12487. FsDatasetSpi.isValidBlock() lacks null pointer check inside and
neither do the callers. Contributed by liumi.
(cherry picked from commit 1524e2e6c52aba966cbbf1d8025ba165688ab9bb)
(cherry picked from commit 845d7611babac68a2b0caa6e4b8963f0c8332540)
---
.../java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
index 53db022..ee64d8d 100644
---
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DiskBalancer.java
@@ -903,6 +903,11 @@ public class DiskBalancer {
while (!iter.atEnd() && item.getErrorCount() < getMaxError(item)) {
try {
ExtendedBlock block = iter.nextBlock();
+ if(null == block){
+ LOG.info("NextBlock call returned null.No valid block to copy. {}",
+ item.toJson());
+ return block;
+ }
if (block != null) {
// A valid block is a finalized block, we iterate until we get
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]