Repository navigation
Stop the Iceberg rw_features perf UPDATE queries #5 and #9 from growing the table on every run - #127380
Merged
alexey-milovidov merged 1 commit intoOct 23, 2026
Conversation
…ouse#9 from growing the table Queries ClickHouse#5 (update_partition_key_move) and ClickHouse#9 (update_every_file) of iceberg_suite_{local,s3}_rw_features are Iceberg ALTER ... UPDATEs whose WHERE still matches after they ran: ClickHouse#5 re-matches the rows it moved to partition 'X', ClickHouse#9 matches l_partkey % 10 = 0 forever. Iceberg UPDATE is merge-on-read, so every execution commits another data file and position-delete file that the next execution scans, and perf.py has no per-run reset. Run time therefore grows monotonically within a series (query_metric_runs_v1, master 2026-10-21: files read per run 6, 8, ..., 18 for ClickHouse#5 and 4, 6, ..., 16 for ClickHouse#9), and the comparison reported both as unstable on 63-87% of master commits (2026-10-08..10-19, issue ClickHouse#100759). Make the prewarm run do the one real rewrite and later runs match nothing, as the suite already does for delete_position_deletes, modify_column and optimize_manifests: ClickHouse#5 adds `AND l_returnflag != 'X'`, ClickHouse#9 becomes `l_quantity + 100 ... AND l_quantity < 100` (TPC-H l_quantity is 1..50, and the predicate stays idempotent for any non-negative value). A mutation that matches nothing commits nothing, so the measured runs time the mutation's planning and merge-on-read scan over a fixed table; the rewrite itself still executes once per server. The ClickHouse#9 comment no longer claims three data files: the Iceberg writer only starts a new file at a block boundary, so the 30000-row single-block INSERT with iceberg_insert_max_rows_in_data_file = 10000 produces one file, on CI as well (ClickHouse#9 measured run0 reads 4 = 2 passes x 2 files). Validated locally on a master build, 16 executions per variant: the old text grows by 2 files read and 1 snapshot per execution (corr(run, duration) 0.99 / 0.92), the new text is constant after the first measured run (corr -0.47 / -0.45) with the expected row counts; perf.py --print-queries shows every other query index unchanged in both suites. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus my own review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261022-111300 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261022-105700 |
Contributor
|
Workflow [PR], commit [9115e99] Summary: ✅
AI ReviewSummaryThe PR makes queries #5 and #9 in both Iceberg read/write performance suites idempotent: warmup performs the update, and measured executions scan a fixed table without adding data files, position-delete files, or snapshots. The change intentionally measures mutation planning and scanning after warmup; the author documents that tradeoff and provides before/after measurements. No actionable findings. Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
3 of 11 tasks
alexey-milovidov
approved these changes
Oct 23, 2026
Merged
via the queue into
ClickHouse:master
with commit Oct 23, 2026
b49341c
527 of 529 checks passed
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-ClickHouse__ClickHouse
that referenced
this pull request
Nov 10, 2026
…wer run over run perf.py repeats every measured query on the same tables without a reset. A query that changes what its next run reads (a growing table, an UPDATE that rewrites its own rows, a file each run appends to) gets slower run over run and is then noisy on master for weeks: 8 of the 10 noisiest tests of the last round in ClickHouse#100759 were this class, all fixed after merge. A PR run could not notice: its status ignores slower/unstable rows, and the A/B diff of a new test mixes noise with the PR's own change. In master_head PR runs (not nightly, not the Iceberg configuration), read the job's own analyze/query-runs.tsv for the tests the PR adds or changes and fail Check Results when a query has, on the tested server, at least 5 runs with corr(run, time) > 0.8 and last/first > 1.2. Only the tested server counts: after the merge both master servers run that code, and requiring both servers drops recall to 0.34-0.94 of heads on last round's offenders against 0.60-0.98. One FAIL child per query carries both servers' run times. A missing file or a malformed row of a changed test fails the check; unknown changed files add a workflow warning instead. test_discovery.changed_tests is the selection, which changed_iceberg_tests now reuses. Validated on 16 real job logs: flagged on master before ClickHouse#127696 / ClickHouse#127380 and on all 8 head jobs of ClickHouse#119147, not flagged after the fixes, 1 of 273 tests on today's master (a query rising on both servers). Related: ClickHouse#100759 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #100759
Related: #116065
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Queries #5 and #9 of the
iceberg_suite_local_rw_featuresandiceberg_suite_s3_rw_featuresperformance tests no longer rewrite the same rows on every measured run, so their timings no longer drift upward within a run series.Description
iceberg_suite_{local,s3}_rw_features#5 and #9 were the noisiest queries in #100759: flaggedunstableon 63-87% of master commits from 2026-10-08 to 10-19, on both arches. Example: arm_release 5/6, 2026-10-15.Both are Iceberg
ALTER TABLE ... UPDATEs whoseWHEREstill matches after they ran: #5 matches the rows it already moved to partitionX, and #9 matchesl_partkey % 10 = 0forever. Every run therefore commits another data file and position-delete file that the next run has to scan, and nothing resets the table between runs. Inquery_metric_runs_v1(master, 10-21), the files read per run are 6, 8, ..., 18 for #5 and 4, 6, ..., 16 for #9.With this change the prewarm run does the one real rewrite and the measured runs match nothing (
AND l_returnflag != 'X';l_quantity + 100 ... AND l_quantity < 100), which is how the suite already handlesdelete_position_deletes,modify_columnandoptimize_manifests. The rewrite and the cross-partition move still execute once per server. The measured runs now time the mutation's planning and its merge-on-read scan over a table that no longer changes.Validation: I ran a local master build with 16 executions per variant. In the old variant, files read grow by 2 and snapshots by 1 per execution, and duration correlates with the run index at 0.99 (#5) and 0.92 (#9). In the new variant, both counts are constant after the first measured run (correlation -0.47 / -0.45).
perf.py --print-queriesshows every other query index unchanged in both suites.The #9 comment no longer says the table has three data files.
iceberg_insert_max_rows_in_data_fileonly splits at block boundaries, so it has one, on CI too.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127380]
Version info
26.11.1.609-master(included in26.11and later)