Hello Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/25219

to look at the new patch set (#3).

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 last batch handed to the channel. A channel starts
the RPCs of the queue's batches in queue order, but they can finish
in any order. Batches are still only removed from the front of the
queue, so a batch that finished before older ones waits for them.
This keeps the last batch handed to a channel in the queue while the
channel has RPCs in flight, and the next batch to send is the one
after it. A channel stays in the idle list while it has a free slot.
EOS is sent once all RPCs of the channel finished. RPCs in flight
when a receiver closes still reach it and are answered with
DATASTREAM_RECVR_CLOSED.

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.
  With K=2 DataStreamTestSlowServiceQueue.TestPrioritizeEos is timing
  sensitive, it failed in 2 of ~30 runs on a loaded machine.
- ran TPC-H, TPC-DS, sort, analytic, join, limit 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 common/thrift/DataSinks.thrift
M fe/src/main/java/org/apache/impala/planner/DataStreamSink.java
5 files changed, 503 insertions(+), 270 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/19/25219/3
--
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: newpatchset
Gerrit-Change-Id: I3be0994c92b75ef67c872a79f76e8398723984f0
Gerrit-Change-Number: 25219
Gerrit-PatchSet: 3
Gerrit-Owner: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>

Reply via email to