From 6906eccec48e3462d17e81e779c3f59d07b43468 Mon Sep 17 00:00:00 2001 From: arp Date: Mon, 15 Sep 2014 15:28:17 -0700 Subject: [PATCH] HDFS-7066. LazyWriter#evictBlocks misses a null check for replicaState. (Contributed by Xiaoyu Yao) Conflicts: hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-6581.txt --- .../hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index 2b16a65b1c4..44a91c12287 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -2410,6 +2410,10 @@ class FsDatasetImpl implements FsDatasetSpi { LazyWriteReplicaTracker.ReplicaState replicaState = lazyWriteReplicaTracker.getNextCandidateForEviction(); + if (replicaState == null) { + break; + } + if (LOG.isDebugEnabled()) { LOG.debug("Evicting block " + replicaState); }