Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.3.0
Description
In `BlockDataStreamOutput#setupStream`, if pipeline mode is enabled, we pass the Pipeline object to the `RatisHelper#getRoutingTable`.
In `RatisHelper#getRoutingTable`, we pick the first datanode in the pipeline as the primary, which from my understanding should be the Datanode closest to the client. However, I'm unable to find the logic that sort the datanodes in the pipeline.
From what I understand, when we open the stream key and request SCM to allocate the block (`OMKeyRequest#allocateBlock`), we need to also pass the clientMachineString so that so that nearest datanodes will be used instead. This should improve the performance of the stream pipeline mode.