You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Ivan Andika (Jira)" <ji...@apache.org> on 2025/12/26 03:15:00 UTC

[jira] [Updated] (HDDS-14243) Simplify and document HddsDispatcher#dispatch

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

Ivan Andika updated HDDS-14243:
-------------------------------
    Description: 
HddsDispatcher#dispatchRequest is a single long complicated function which was called by ContainerStateMachine#dispatchCommand which are called in multiple places
 * ContainerStateMachine#writeStateMachineData: For Write Pipeline V1 when handling writeChunk
 * ContainerStateMachine#readMachineData: For Write Pipeline V1 when reading the cached writeChunk data before replicating to the followers
 * ContainerStateMachine#getStreamDataChannel : For Streaming Write Pipeline:
 * ContainerStateMachine#query: For read requests (this should be unused)

Even if HddsDispatcher#dispatchRequest call KeyValueHandler#handle which will have a defer to handler request, the complicated HddsDispatcher#dispatchRequest and lack of documentation makes it hard to know which handler is going to be called.

For example, I'm trying to understand which ContainerStateMachine#applyTransaction code path is going to be triggered when client calls sendForward, but it's hard to determine since 1) HddsDispatcher#dispatchRequest is complicated 2) ContainerStateMachine#applyTransaction itself has more special logic (whether to set BCSID, etc).

We need to simplify and document this.

  was:
HddsDispatcher#dispatchRequest is a single long complicated function which was called by ContainerStateMachine#dispatchCommand which are called in multiple places
 * ContainerStateMachine#writeStateMachineData: For Write Pipeline V1 when handling writeChunk
 * ContainerStateMachine#readMachineData: For Write Pipeline V1 when reading the cached writeChunk data before replicating to the followers
 * ContainerStateMachine#getStreamDataChannel : For Streaming Write Pipeline:
 * ContainerStateMachine#query: For read requests (this should be unused)

Even if HddsDispatcher#dispatchRequest call KeyValueHandler#handle which will have a defer to handler request, the complicated HddsDispatcher#dispatchRequest and lack of documentation makes it hard to know which handler is going to be called.

We need to simplify and document this.


> Simplify and document HddsDispatcher#dispatch
> ---------------------------------------------
>
>                 Key: HDDS-14243
>                 URL: https://issues.apache.org/jira/browse/HDDS-14243
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Ivan Andika
>            Assignee: Ivan Andika
>            Priority: Major
>
> HddsDispatcher#dispatchRequest is a single long complicated function which was called by ContainerStateMachine#dispatchCommand which are called in multiple places
>  * ContainerStateMachine#writeStateMachineData: For Write Pipeline V1 when handling writeChunk
>  * ContainerStateMachine#readMachineData: For Write Pipeline V1 when reading the cached writeChunk data before replicating to the followers
>  * ContainerStateMachine#getStreamDataChannel : For Streaming Write Pipeline:
>  * ContainerStateMachine#query: For read requests (this should be unused)
> Even if HddsDispatcher#dispatchRequest call KeyValueHandler#handle which will have a defer to handler request, the complicated HddsDispatcher#dispatchRequest and lack of documentation makes it hard to know which handler is going to be called.
> For example, I'm trying to understand which ContainerStateMachine#applyTransaction code path is going to be triggered when client calls sendForward, but it's hard to determine since 1) HddsDispatcher#dispatchRequest is complicated 2) ContainerStateMachine#applyTransaction itself has more special logic (whether to set BCSID, etc).
> We need to simplify and document this.



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