|
@@ -1885,28 +1885,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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|