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

Reduce number of sortDatanodes RPC calls

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Done
    • None
    • 1.1.0
    • OM
    • None

    Description

      KeyManagerImpl#listStatus and the sortDatanodeInPipeline helper method sort datanodes using individual RPC call for each key location info.

        private void sortDatanodeInPipeline(OmKeyInfo keyInfo, String clientMachine) {
          if (keyInfo != null && clientMachine != null && !clientMachine.isEmpty()) {
            for (OmKeyLocationInfoGroup key : keyInfo.getKeyLocationVersions()) {
              key.getLocationList().forEach(k -> {
                List<DatanodeDetails> nodes = k.getPipeline().getNodes();
                if (nodes == null || nodes.isEmpty()) {
                  LOG.warn("Datanodes for pipeline {} is empty",
                      k.getPipeline().getId().toString());
                  return;
                }
                List<String> nodeList = new ArrayList<>();
                nodes.stream().forEach(node ->
                    nodeList.add(node.getUuidString()));
                try {
                  List<DatanodeDetails> sortedNodes = scmClient.getBlockClient()
                      .sortDatanodes(nodeList, clientMachine);
                  k.getPipeline().setNodesInOrder(sortedNodes);
      

      Problems, possible improvements:

      1. All location versions are processed. Would it be enough to process only the "latest" version, which is used for read?
      2. Each key location is queried separately, even if the same pipeline was already updated in a previous request. Could be improved by keeping track of processed pipelines.
      3. Further improvement may be possible by sending a single sortDatanodes request for all datanodes in all relevant pipelines, then creating the per-pipeline lists locally.

      CC bharat

      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: