You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org> on 2026/10/23 19:57:06 UTC

[Impala-ASF-CR] PROTOTYPE: Size hash exchange sender buffers from the channel count

Zoltan Borok-Nagy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/25205


Change subject: PROTOTYPE: Size hash exchange sender buffers from the channel count
......................................................................

PROTOTYPE: Size hash exchange sender buffers from the channel count

A hash partitioned sender keeps two row batches per channel and moves
one batch per channel per network round trip. With one size for all
senders, a size that keeps the memory of senders with many channels
low leaves senders with few channels bound by round trips.

This builds on change 25141 for IMPALA-15512, which sends a channel's
batch once its serialized size reaches --data_stream_sender_buffer_size
(64 KB) and uses the same size in the planner. On top of the flat 64 KB,
hash and Kudu partitioned senders use
clamp(--data_stream_sender_buffer_budget_bytes / (2 * channels),
--data_stream_sender_buffer_size,
--data_stream_sender_max_channel_buffer_bytes) per channel. The new
flags default to 4 MB and 256 KB: up to 8 channels get 256 KB, 32 or
more keep 64 KB, so a sender's batches stay within about 4 MB unless the
flat size needs more. A budget of 0 gives the flat size. The size is
shown as PerChannelBufferSize in the profile. The flags reach the
planner through BackendGflags, and DataStreamSink uses the same size for
the sender buffer and receiver queue estimates, capped by the estimated
bytes per sender and channel.

Testing:
- TPC-DS SF100, 5 executors, MT_DOP=0, against a 16 KB buffer:
  adaptive -21.9% (-9.6% without q72/q78), a flat 64 KB -20.7%
  (-9.4%) in a separate run. Two runs of a flat 128 KB gave -21.6%
  and -25.2%, so the data cannot tell what adaptive adds over a flat
  64 KB. These runs predate change 25141 and sized batches by row
  count (about 2x the flag); its flat 64 KB was not measured. Much of
  the gain came from 0.5-0.7 ms round trips to two hosts; the median
  query did not change.
- Syntax-checked only, not built or run. Planner test expectations
  are not updated; estimates of hash exchanges with few receivers
  change.

Change-Id: I96b35b1b73f1b57f41ae06a27d9b44ecad3c050c
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/util/backend-gflag-util.cc
M common/thrift/BackendGflags.thrift
M fe/src/main/java/org/apache/impala/planner/DataStreamSink.java
M fe/src/main/java/org/apache/impala/service/BackendConfig.java
7 files changed, 115 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/05/25205/1
-- 
To view, visit http://gerrit.cloudera.org:8080/25205
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I96b35b1b73f1b57f41ae06a27d9b44ecad3c050c
Gerrit-Change-Number: 25205
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] PROTOTYPE: Size hash exchange sender buffers from the channel count

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/25205 )

Change subject: PROTOTYPE: Size hash exchange sender buffers from the channel count
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/24665/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/25205
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I96b35b1b73f1b57f41ae06a27d9b44ecad3c050c
Gerrit-Change-Number: 25205
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Fri, 23 Oct 2026 20:19:13 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] PROTOTYPE IMPALA-15512: Size hash exchange sender buffers from the channel count

Posted by "Csaba Ringhofer (Code Review)" <ge...@cloudera.org>.
Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/25205 )

Change subject: PROTOTYPE IMPALA-15512: Size hash exchange sender buffers from the channel count
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/25205/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/25205/2//COMMIT_MSG@18
PS2, Line 18: clamp(--data_stream_sender_buffer_budget_bytes / (2 * channels),
            : --data_stream_sender_buffer_size,
            : --data_stream_sender_max_channel_buffer_bytes) per channel. The new
            : flags default to 4 MB and 256 KB: up to 8 channels get 256 KB, 32 or
            : more keep 64 KB, so a sender's batches stay within about 4 MB unless the
            : flat size needs more.
This adaptive logic looks great, but my preference would be to apply it to number of batches sent in parallel instead of the size of buffers. Currently Impala can't send multiple batches in parallel, but it should. Few related pacthes:
https://gerrit.cloudera.org/#/c/21579/ - was just merged and it adds a queue to the sender
https://gerrit.cloudera.org/#/c/25067/ - prototype to send multiple batches (based on old state, not the one with queue)



-- 
To view, visit http://gerrit.cloudera.org:8080/25205
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I96b35b1b73f1b57f41ae06a27d9b44ecad3c050c
Gerrit-Change-Number: 25205
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Tue, 27 Oct 2026 07:08:11 +0000
Gerrit-HasComments: Yes