Repository navigation
Conversation
The run-trend check (ClickHouse#129330) fails a PR when the time of a query of a test it adds or changes keeps growing with each run on the tested server. Its premise is that each run reads what the previous runs changed. A query that only reads cannot change what its next run reads, so a trend there comes from the host. On ClickHouse#100394, `read_in_order_direct_io ClickHouse#1` read the same rows, bytes and marks every run with flat CPU time, while the disk read time under `min_bytes_to_use_direct_io` stepped up on both servers at the same second; the same step shows in 23 of 27 arm jobs of that PR. All 6 failures of the check since its merge are read-only queries. perf.py already decides per test whether the measured queries write, to stop merges for read-only tests (`WRITE_KEYWORDS`, `first_keyword`). That predicate is now `query_writes`, and perf.py prints `read-only <query_index>` for every measured query that does not write. compare.sh collects the records into `analyze/read-only-queries.tsv`, and `find_run_trends` skips those queries. Without the file the check behaves as before; a malformed row of a changed test makes it fail as "could not check", like a malformed `query-runs.tsv` row. Writing and shell queries are judged as before, so state growth (Iceberg write suites, `insert_sequential_and_background_merges`, `polymorphic_parts_*`) is still caught. No extra run, no threshold change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ites The first keyword of `WITH y AS (...) INSERT INTO x ...` is `WITH`, and of `SELECT 1 PARALLEL WITH INSERT INTO t ...` it is `SELECT`, so `query_writes` called both read-only: the run-trend check skipped them and stop-merges stopped merges for their tests. No test in tests/performance uses either form. 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; 2 rounds, 1 finding each) plus my own review (2 findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261118-111500 |
|
cc @maxknv, could you review this? The perf comparison run-trend check now skips queries that only read (classified by the write rule perf.py already uses for stop-merges, per query), since a read-only query cannot change what its next run reads; all 6 failures of the check since #129330 were such queries. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261118-100201 |
|
Workflow [PR], commit [80920d2] Summary: ✅
AI ReviewSummaryThe PR excludes queries classified as read-only from the performance run-trend gate while retaining checks for writing and shell queries. No material findings remain after reviewing the diff, current code, and all prior discussion. Focused local validation passed: 905 performance XML files, 8,000 enabled query instances, and no changed merge-control decisions. Checks covered mixed queries, grouped statements, Output consumers checked: Final VerdictStatus: ✅ Approve |
The run-trend check of the performance comparison failed on query #1 (`ORDER BY key DESC`) on ARM in two consecutive runs. Rows, bytes and CPU time are the same in every run. After about four seconds of continuous `O_DIRECT` reading, the time steps from ~0.61 s to ~0.80 s on both the tested and the reference server. The AMD runners measure ~0.82 s from the first run. So the first measured runs were faster than the steady state, not later ones slower. Read the table a few times in `fill_query` statements so that the measured runs start at the steady state. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=100394&sha=e0bf56ffe49a895ddaff980122a57197002efab1&name_0=PR&name_1=Performance%20Comparison%20%28arm_release%2C%20master_head%2C%208%2F8%29 #100394 Related: #132631 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #100394
Related: #129330
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required: CI-only change.
Description
The run-trend check (#129330) failed
Performance Comparison (arm_release, master_head, 1/8)of #100394 onread_in_order_direct_io #1,SELECT * FROM read_in_order_direct_io ORDER BY key DESC FORMAT Null. Every run read the same rows, bytes and marks with flat CPU time; from the third run the disk read time undermin_bytes_to_use_direct_iorose on both servers at the same second. The same step shows in 23 of the 27 arm jobs of that PR since 2026-10-02, 14 of them over the thresholds. All 6 failures of the check since its merge are queries that only read.A query that only reads cannot change what its next run reads, so the check's premise ("each run reads what the previous runs changed") does not hold for it. The check now skips such queries, using the rule
perf.pyalready applies to stop merges for a read-only test (WRITE_KEYWORDSandfirst_keyword, nowquery_writes, which also countsWITH ... INSERTandPARALLEL WITHas writing), per query:perf.pyprintsread-only <query_index>,compare.shcollects it intoanalyze/read-only-queries.tsv,find_run_trendsskips those queries. Shell queries and queries withINSERT,ALTER,OPTIMIZE,SYSTEM, ... are judged as before.Backtest on CIDB
query_metric_runs_v1(2026-10-08 to 11-17): 7606 read-only queries were flagged in 0.08% (amd) / 0.03% (arm) of their series, none butread_in_order_direct_io #1in 10% or more; the 29 writing queries flagged that often (Iceberg write suites,insert_sequential_and_background_merges,polymorphic_parts_*, ...) stay checked.Validated locally: on the CI job's
query-runs.tsvthe old check fails and the new one passes; a test whoseALTER UPDATEgrows each run still fails;perf.pymarks exactly the read-only queries of a mixed test, andstop-mergesdecides as before for every existing test.Unlike #131251, this adds no run. The alternative is reverting #129330.
Workflow [PR]
Sync PR [sync-upstream/pr/132631]