diff --git a/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java b/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java index ba46525683b46..53d523e89f3ae 100644 --- a/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java +++ b/server/src/main/java/org/opensearch/gateway/ReplicaShardBatchAllocator.java @@ -10,7 +10,6 @@ import org.apache.logging.log4j.Logger; import org.opensearch.cluster.node.DiscoveryNode; -import org.opensearch.cluster.routing.RoutingNodes; import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.cluster.routing.UnassignedInfo; import org.opensearch.cluster.routing.allocation.AllocateUnassignedDecision; @@ -47,7 +46,6 @@ public abstract class ReplicaShardBatchAllocator extends ReplicaShardAllocator { * @param shardBatches a list of shard batches to check for existing recoveries */ public void processExistingRecoveries(RoutingAllocation allocation, List> shardBatches) { - RoutingNodes routingNodes = allocation.routingNodes(); List shardCancellationActions = new ArrayList<>(); // iterate through the batches, each batch needs to be processed together as fetch call should be made for shards from same batch for (List shardBatch : shardBatches) { @@ -180,9 +178,7 @@ private Map convertToNodeStoreFilesMetadataMa data.getData().forEach((key, value) -> { Map batch = value.getNodeStoreFilesMetadataBatch(); NodeStoreFilesMetadata metadata = batch.get(unassignedShard.shardId()); - if (metadata != null && metadata.getStoreFileFetchException() == null) { - map.put(key, metadata.storeFilesMetadata()); - } + map.put(key, metadata.storeFilesMetadata()); }); return map;