Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-9674

Read from non-datanode host does not consider topology

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • SCM

    Description

        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;
      

      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. While read cannot be host-local in this case, it still could benefit from being rack-local.

      Examples where such non-datanode hosts may occur:

      • edge nodes
      • dedicated metadata nodes
      • Docker/Kubernetes containers running only one service

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: