You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Attila Doroszlai (Jira)" <ji...@apache.org> on 2023/11/11 15:49:00 UTC
[jira] [Updated] (HDDS-9674) Read from non-datanode host does not consider topology
[ https://issues.apache.org/jira/browse/HDDS-9674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Attila Doroszlai updated HDDS-9674:
-----------------------------------
Description:
{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. 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
was:
{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
> 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
> Priority: Major
>
> {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. 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
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org