HDDS-1850. ReplicationManager should consider inflight replication and deletion while picking datanode for re-replication.
Signed-off-by: Anu Engineer <aengineer@apache.org>
This commit is contained in:
parent
b41ef61ebc
commit
2b1d8aedbb
@ -483,8 +483,14 @@ private void handleUnderReplicatedContainer(final ContainerInfo container,
|
|||||||
final int replicationFactor = container
|
final int replicationFactor = container
|
||||||
.getReplicationFactor().getNumber();
|
.getReplicationFactor().getNumber();
|
||||||
final int delta = replicationFactor - getReplicaCount(id, replicas);
|
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
|
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" +
|
LOG.info("Container {} is under replicated. Expected replica count" +
|
||||||
" is {}, but found {}.", id, replicationFactor,
|
" is {}, but found {}.", id, replicationFactor,
|
||||||
|
Loading…
Reference in New Issue
Block a user