This is an automated email from the ASF dual-hosted git repository.
aengineer 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 2b1d8ae HDDS-1850. ReplicationManager should consider inflight
replication and deletion while picking datanode for re-replication.
2b1d8ae is described below
commit 2b1d8aedbb669cf412465bf7a5762c8aeda52faa
Author: Nanda kumar <[email protected]>
AuthorDate: Thu Jul 25 15:07:07 2019 +0530
HDDS-1850. ReplicationManager should consider inflight replication and
deletion while picking datanode for re-replication.
Signed-off-by: Anu Engineer <[email protected]>
---
.../org/apache/hadoop/hdds/scm/container/ReplicationManager.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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 33bf931..0557ea1 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
@@ -483,8 +483,14 @@ public class ReplicationManager {
final int replicationFactor = container
.getReplicationFactor().getNumber();
final int delta = replicationFactor - getReplicaCount(id, replicas);
+ final List<DatanodeDetails> excludeList = replicas.stream()
+ .map(ContainerReplica::getDatanodeDetails)
+ .collect(Collectors.toList());
+ inflightReplication.get(id).stream().map(r -> r.datanode)
+ .forEach(excludeList::add);
final List<DatanodeDetails> selectedDatanodes = containerPlacement
- .chooseDatanodes(source, null, delta, container.getUsedBytes());
+ .chooseDatanodes(excludeList, null, delta,
+ container.getUsedBytes());
LOG.info("Container {} is under replicated. Expected replica count" +
" is {}, but found {}.", id, replicationFactor,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]