Repository navigation
Shuffle input rows in 05407_distributed_plan_exchange_compression_default - #127186
Conversation
…ault The test checks that the streaming exchange compresses, i.e. that it writes fewer bytes to the sockets than the Native blocks it serializes. Since ClickHouse#123537 a distributed aggregation without NDV statistics shuffles partial aggregation states. With a randomized `group_by_two_level_threshold = 1` or `group_by_two_level_threshold_bytes = 1` the partial aggregation is two-level, so the states cross the exchange as ~1000 packets of ~110 bytes, and the per-packet framing, written for every codec, outweighs what the codec saves: LZ4 sends 133 KB for 112 KB serialized (NONE sends 156 KB). Force the shuffle of the input rows, as 478d701 did for the sibling 05218: the exchange then carries ~4 MB in 14 packets whatever the aggregation settings, and LZ4 sends 11% of it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261021-133100 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261021-130407 |
|
cc @davenger, could you review this and add the |
|
Workflow [PR], commit [b42f813] Summary: ✅ AI ReviewSummaryThe PR sets Missing context / blind spots
Final VerdictStatus: ✅ Approve. No review changes requested. |
|
@groeneai Should there be |
|
No. I measured this on the PR's binary for the
With |
90fce32
Related: #126743
Related: #123537
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Test-only change, no changelog entry required.
Description
05407_distributed_plan_exchange_compression_defaultfails since #123537 merged:05407_default,05407_empty_lz4and05407_zstd_exchange_levelprint1 0instead of1 1in thecompressedcolumn (5 failures in about 2 hours, 2 of them on master:amd_debug,
arm_binary ParallelReplicas).
Compression is applied, but the oracle
sent < serializedno longer holds. Without NDV statistics fork(a randomizedauto_statistics_typeswithoutuniq*, oruse_statistics = 0) the aggregation now shuffles partial states, and a randomizedgroup_by_two_level_threshold = 1orgroup_by_two_level_threshold_bytes = 1makes them two-level. The exchange then sends about 1000packets of about 110 bytes. The per-packet framing, written for every codec, costs more than LZ4 saves: LZ4 sends 133 KB for 112 KB
serialized, while NONE sends 156 KB.
The fix sets
distributed_plan_force_shuffle_aggregation = 1, as 478d701 did for05218. The exchange then carries the inputrows (about 4 MB in 14 packets) whatever the aggregation settings, which is the payload this query had before #123537. The reference
is unchanged.
Validation: with fixed settings, the unpatched test failed 10/10 (CI's diff) and the patched one passed 50/50, both for
group_by_two_level_threshold{,_bytes} = 1+auto_statistics_types = 'tdigest'and forgroup_by_two_level_threshold_bytes = 1+use_statistics = 0. With full randomization it passed 250/250. Before #123537 the unpatched test passed under the same settings. Withdistributed_plan_exchange_compression_method = 'NONE'on the default run, the patched test fails as it should.Workflow [PR]
Sync PR [sync-upstream/pr/127186]
Version info
26.11.1.472-master(included in26.11and later)