Csaba Ringhofer has uploaded this change for review. ( http://gerrit.cloudera.org:8080/25219
Change subject: POC IMPALA-15519: Allow several in-flight RPCs per channel ...................................................................... POC IMPALA-15519: Allow several in-flight RPCs per channel A data stream channel allowed one TransmitData RPC in flight, so a sender moved at most one batch per network round trip per channel. This builds on the OutboundQueue added in IMPALA-15080. The per-RPC state of a channel (controller, response, in-flight batch) moves into an RpcSlot and a channel owns K slots. K is set by the new hidden flag --data_stream_sender_max_inflight_rpcs (default 1, at most 8), so the default behavior doesn't change. OutboundQueue keeps per-channel bookkeeping: the number of RPCs in flight and the sequence number of the next batch to send. A channel starts the RPCs of the queue's batches in queue order, but they can finish in any order, so a batch is released once all channels finished it, even if older batches are still in flight. A channel stays in the idle list while it has a free slot. EOS is sent once all RPCs of the channel finished. The receiver can process the RPCs in flight at the same time in any order, so K is always 1 for: - merging exchanges, which need the batches of each sender in order. The planner sets the new field TDataStreamSink.dest_is_merging. - Kudu partitioned senders, as the order of the rows can affect the result of UPSERTs with duplicate keys. Other senders, including broadcast and the ones returning results to the coordinator, can use K > 1. K = 2 needs queue depths that allow 2 ready-to-send batches per channel: --data_stream_sender_max_inflight_rpcs=2 --data_stream_sender_per_channel_queue_depth=3 --data_stream_sender_broadcast_queue_depth=3 If K > 1, the profile shows ExpMaxRpcsInFlightPerChannel and the counter ParallelRpcs (RPCs started while the channel had another RPC in flight). Also fixed: - Channel::TransmitData() left the RPC marked as in flight if it couldn't be started, so Teardown() cancelled an empty controller and waited forever. - RetryCb() didn't notify the queue if the retry failed, so WaitUntilEmpty() and WaitForCapacity() only returned on cancellation. The planner's memory estimate in DataStreamSink is not updated yet. Based on the prototype https://gerrit.cloudera.org/#/c/25067/. Testing: - added DataStreamTestParallelRpcs.BasicTest, which delays TransmitData RPCs randomly so the RPCs of a channel finish out of order - merging receivers in data-stream-test check that the merged rows are sorted - ran data-stream-test with default flags and with K=2 for all tests - ran TPC-H, TPC-DS, sort, analytic, join and Iceberg position delete query tests on a minicluster with the flags above - ran the exchange custom cluster tests with default flags Change-Id: I3be0994c92b75ef67c872a79f76e8398723984f0 Assisted-by: Claude Opus 5.5 (Claude Code) --- M be/src/runtime/data-stream-test.cc M be/src/runtime/krpc-data-stream-sender.cc M be/src/runtime/krpc-data-stream-sender.h M be/src/runtime/outbound-row-batch.h M common/thrift/DataSinks.thrift M fe/src/main/java/org/apache/impala/planner/DataStreamSink.java 6 files changed, 537 insertions(+), 273 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/19/25219/1 -- To view, visit http://gerrit.cloudera.org:8080/25219 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3be0994c92b75ef67c872a79f76e8398723984f0 Gerrit-Change-Number: 25219 Gerrit-PatchSet: 1 Gerrit-Owner: Csaba Ringhofer <[email protected]>
