You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Kirill Sizov (Jira)" <ji...@apache.org> on 2023/11/08 12:29:00 UTC

[jira] [Updated] (HDDS-9651) Restore random selection of datanode when reading RATIS objects

     [ https://issues.apache.org/jira/browse/HDDS-9651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kirill Sizov updated HDDS-9651:
-------------------------------
    Description: 
*Observations*
During performance testing, an issue was identified where data written as RATIS/THREE was primarily read from a single datanode, typically the pipeline leader. The experiment involved the following steps:
* Upload a set of files to a cluster using RATIS/THREE pipelines.
* Attempt to read all those files.
* Monitor datanode metrics.

Notably, all reads were performed from the leader datanodes.

*Motivation*
Reading all the data from a single datanode creates an uneven load on the cluster and reduces the potential total read throughput.

*Reasons*
Upon researching this issue, two root causes were identified:

# The RATIS object reading is currently implemented using a gRPC client (specifically, the {{BlockInputStream.getChunkInfos()}} method switches the pipeline type to {{STANDALONE}}, and the {{XceiverClientManager}} selects a gRPC client). 
Unfortunately, this configuration does not allow the Ozone Manager to determine the client's host address since the {{OmMetadatareader.getClientAddress()}} method only works for Hadoop RPC interactions. This failure to detect the client's address results in an empty {{nodesInOrder}} field in the response received by the client, causing the datanodes to be read in the default order in the pipeline, with the leader node being read first.

#  As the SCM cannot locate the client relative to the cluster topology (see {{ScmBlockProtocolServer.sortDatanodes}}), the client receives a Pipeline with a null {{nodesInOrder}} field, resulting in reads being done primarily from the leader datanode.


Once these issues are resolved, it is expected that read throughput will improve, and the cluster's load when reading RATIS/THREE objects will become more balanced.



  was:
*Observations*
During the performance testing it was found that the data written as RATIS/THREE was later read only from one datanode (pipeline leader mostly).
The experiment was simple:
* just upload a pack of files to a cluster into RATIS/THREE pipelines
* read all those files
* check datanode metrics 

The reads were performed only from leader datanodes.

*Motivation*
Reading all data from the same datanode produces uneven load on the cluster and reduces the potential total read throughput.

*Reasons*
While researching this issue two causes were identified.
# RATIS object reading is currently implemented via a gRPC client ({{BlockInputStream.getChunkInfos()}} changes pipeline type to {{STANDALONE}} and further {{XceiverClientManager}} choses gRPC client). 
Unfortunately such configuration does not allow to get client host on the OM side since {{OmMetadatareader.getClientAddress()}} works only for Hadoop RPC interactions. 

Failing to detect client address in turn leads to an empty {{nodesInOrder}} field in the response that a client receives, thus the order of datanodes to read is determined by the default order in a pipeline (leader first).

# Since SCM could not locate the client relative to the cluster topology (see {{ScmBlockProtocolServer.sortDatanodes}} method), the client receives a Pipeline with null {{nodesInOrder}} field, and reads are done only from the leader as well.


Once these issues are fixed, read throughput is expected to increase and load on the cluster when reading RATIS/THREE objects expected to be more balanced.




> Restore random selection of datanode when reading RATIS objects
> ---------------------------------------------------------------
>
>                 Key: HDDS-9651
>                 URL: https://issues.apache.org/jira/browse/HDDS-9651
>             Project: Apache Ozone
>          Issue Type: Task
>            Reporter: Kirill Sizov
>            Priority: Major
>
> *Observations*
> During performance testing, an issue was identified where data written as RATIS/THREE was primarily read from a single datanode, typically the pipeline leader. The experiment involved the following steps:
> * Upload a set of files to a cluster using RATIS/THREE pipelines.
> * Attempt to read all those files.
> * Monitor datanode metrics.
> Notably, all reads were performed from the leader datanodes.
> *Motivation*
> Reading all the data from a single datanode creates an uneven load on the cluster and reduces the potential total read throughput.
> *Reasons*
> Upon researching this issue, two root causes were identified:
> # The RATIS object reading is currently implemented using a gRPC client (specifically, the {{BlockInputStream.getChunkInfos()}} method switches the pipeline type to {{STANDALONE}}, and the {{XceiverClientManager}} selects a gRPC client). 
> Unfortunately, this configuration does not allow the Ozone Manager to determine the client's host address since the {{OmMetadatareader.getClientAddress()}} method only works for Hadoop RPC interactions. This failure to detect the client's address results in an empty {{nodesInOrder}} field in the response received by the client, causing the datanodes to be read in the default order in the pipeline, with the leader node being read first.
> #  As the SCM cannot locate the client relative to the cluster topology (see {{ScmBlockProtocolServer.sortDatanodes}}), the client receives a Pipeline with a null {{nodesInOrder}} field, resulting in reads being done primarily from the leader datanode.
> Once these issues are resolved, it is expected that read throughput will improve, and the cluster's load when reading RATIS/THREE objects will become more balanced.



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