diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java index 0557ea10d20..a8dff405e43 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java @@ -486,8 +486,11 @@ public class ReplicationManager { final List excludeList = replicas.stream() .map(ContainerReplica::getDatanodeDetails) .collect(Collectors.toList()); - inflightReplication.get(id).stream().map(r -> r.datanode) - .forEach(excludeList::add); + List actionList = inflightReplication.get(id); + if (actionList != null) { + actionList.stream().map(r -> r.datanode) + .forEach(excludeList::add); + } final List selectedDatanodes = containerPlacement .chooseDatanodes(excludeList, null, delta, container.getUsedBytes());