[ 
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 
during the initial ContainerStateMachine#stream during stream init
 * ContainerStateMachine#query: For read requests (this should be unused in 
Ozone since Ozone uses normal gRPC read)

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.

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.


> 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 
> during the initial ContainerStateMachine#stream during stream init
>  * ContainerStateMachine#query: For read requests (this should be unused in 
> Ozone since Ozone uses normal gRPC read)
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to