You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by we...@apache.org on 2020/10/23 20:06:32 UTC
[hadoop] branch trunk updated: HDFS-15644. Failed volumes can cause
DNs to stop block reporting. Contributed by Ahmed Hussein.
This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 74634eb HDFS-15644. Failed volumes can cause DNs to stop block reporting. Contributed by Ahmed Hussein.
74634eb is described below
commit 74634eb002717a9684d00f0e9dc263ab7eb49246
Author: Wei-Chiu Chuang <we...@apache.org>
AuthorDate: Fri Oct 23 12:05:53 2020 -0700
HDFS-15644. Failed volumes can cause DNs to stop block reporting. Contributed by Ahmed Hussein.
---
.../datanode/fsdataset/impl/FsDatasetImpl.java | 28 ++++++++++++----------
1 file changed, 16 insertions(+), 12 deletions(-)
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 e65e37f..ed77992 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
@@ -1957,28 +1957,32 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
continue;
}
String volStorageID = b.getVolume().getStorageID();
- if (!builders.containsKey(volStorageID)) {
- if (!missingVolumesReported.contains(volStorageID)) {
- LOG.warn("Storage volume: " + volStorageID + " missing for the"
- + " replica block: " + b + ". Probably being removed!");
- missingVolumesReported.add(volStorageID);
- }
- continue;
- }
switch(b.getState()) {
case FINALIZED:
case RBW:
case RWR:
- builders.get(volStorageID).add(b);
break;
case RUR:
- ReplicaInfo orig = b.getOriginalReplica();
- builders.get(volStorageID).add(orig);
+ // use the original replica.
+ b = b.getOriginalReplica();
break;
case TEMPORARY:
- break;
+ continue;
default:
assert false : "Illegal ReplicaInfo state.";
+ continue;
+ }
+ BlockListAsLongs.Builder storageBuilder = builders.get(volStorageID);
+ // a storage in the process of failing will not be in the volumes list
+ // but will be in the replica map.
+ if (storageBuilder != null) {
+ storageBuilder.add(b);
+ } else {
+ if (!missingVolumesReported.contains(volStorageID)) {
+ LOG.warn("Storage volume: " + volStorageID + " missing for the"
+ + " replica block: " + b + ". Probably being removed!");
+ missingVolumesReported.add(volStorageID);
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org