Stephen O'Donnell created HDDS-8416:
---------------------------------------

             Summary: ReplicationManager: RatisUnderReplication handler should 
not sort sources by BCSID
                 Key: HDDS-8416
                 URL: https://issues.apache.org/jira/browse/HDDS-8416
             Project: Apache Ozone
          Issue Type: Sub-task
            Reporter: Stephen O'Donnell


In the RatisUnderReplicationHander, the sources are sorted by BSCIS, intending 
that the highest ID is used as the source for the replication:

{code}
    return replicaCount.getReplicas().stream()
        .filter(predicate)
        .filter(r -> {
          try {
            return replicationManager.getNodeStatus(r.getDatanodeDetails())
                .isHealthy();
          } catch (NodeNotFoundException e) {
            return false;
          }
        })
        .filter(r -> !pendingDeletion.contains(r.getDatanodeDetails()))
        .sorted((r1, r2) -> r2.getSequenceId().compareTo(r1.getSequenceId()))
        .map(ContainerReplica::getDatanodeDetails)
        .collect(Collectors.toList());
{code}

However, the list is later source by load for push replication, or shuffled for 
pull replication, so the sort is not having the intended effect.

We should remove the sort here, but also consider if we should remove any 
sources that are not at the highest BCSID.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to