Attila Doroszlai created HDDS-9674:
--------------------------------------

             Summary: Read from non-datanode host does not consider topology
                 Key: HDDS-9674
                 URL: https://issues.apache.org/jira/browse/HDDS-9674
             Project: Apache Ozone
          Issue Type: Bug
          Components: SCM
            Reporter: Attila Doroszlai


{code:title=https://github.com/apache/ozone/blob/0c7ae8007ddb4725e10668299613668ef9ad19a7/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMBlockProtocolServer.java#L338-L360}
  public List<DatanodeDetails> sortDatanodes(List<String> nodes,
      String clientMachine) {
    boolean auditSuccess = true;
    try {
      NodeManager nodeManager = scm.getScmNodeManager();
      Node client = null;
      List<DatanodeDetails> possibleClients =
          nodeManager.getNodesByAddress(clientMachine);
      if (possibleClients.size() > 0) {
        client = possibleClients.get(0);
      }
      List<Node> nodeList = new ArrayList();
      nodes.stream().forEach(uuid -> {
        DatanodeDetails node = nodeManager.getNodeByUuid(uuid);
        if (node != null) {
          nodeList.add(node);
        }
      });
      List<? extends Node> sortedNodeList = scm.getClusterMap()
          .sortByDistanceCost(client, nodeList, nodes.size());
      List<DatanodeDetails> ret = new ArrayList<>();
      sortedNodeList.stream().forEach(node -> ret.add((DatanodeDetails)node));
      return ret;
{code}

Client's node (place in the topology) is looked up via 
{{SCMNodeManager.getNodesByAddress}}.  But {{SCMNodeManager}} only knows about 
datanodes.  If the request comes from a host which does not run Ozone Datanode, 
then read will not be topology-aware.

Examples where such non-datanode hosts may occur:
 * edge nodes
 * dedicated metadata nodes
 * Docker/Kubernetes containers running only one service



--
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