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 ae...@apache.org on 2019/07/25 22:01:51 UTC

[hadoop] branch ozone-0.4.1 updated: HDDS-1850. ReplicationManager should consider inflight replication and deletion while picking datanode for re-replication.

This is an automated email from the ASF dual-hosted git repository.

aengineer pushed a commit to branch ozone-0.4.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/ozone-0.4.1 by this push:
     new 9a5ebec  HDDS-1850. ReplicationManager should consider inflight replication and deletion while picking datanode for re-replication.
9a5ebec is described below

commit 9a5ebecf0457b02eb30a6f32132d70e7eaac2579
Author: Nanda kumar <na...@apache.org>
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 <ae...@apache.org>
    (cherry picked from commit 2b1d8aedbb669cf412465bf7a5762c8aeda52faa)
---
 .../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: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org