Skip to content

Add synth io lags to Iceberg perf CI - #119976

Merged
arsenmuk merged 5 commits into
masterfrom
arsenmuk/ClickHouse-public-perf-ci-synth-lags
Oct 28, 2026
Merged

arsenmuk merged 5 commits into
masterfrom
arsenmuk/ClickHouse-public-perf-ci-synth-lags

Conversation

@arsenmuk

@arsenmuk arsenmuk commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Adds synthetic lags (via failpoints) into iceberg_suite_* perf tests to simulate io delays and to stress alternative code paths. It's more async focused compared to existing iceberg tests, where Local+S3 remote endpoints reply immediately.
Also, added a new perf test macro - failpoint. It enables/disables the given failpoint in a safe way: if the failpoint doesn't exist on any left/right version - the entire test will be skipped.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add synth io lags to Iceberg perf CI


Workflow [PR]
Sync PR [sync-upstream/pr/119976]

Version info

  • Merged into: 26.11.1.847-master (included in 26.11 and later)

arsenmuk added a commit that referenced this pull request Sep 14, 2026
Mark every SYSTEM ENABLE FAILPOINT fill query of the synthetic-IO suites with
do_not_check_in_pr="119976": the reference (left) build predates these
failpoints, so without the attribute the enable fails there, kills the test,
and leaves the failpoints enabled on the new server for the rest of the batch.
With it, perf.py tolerates the reference-side failure and runs the suites on
the new server only, until the failpoints reach the reference builds - then
the attribute becomes inert and real left/right comparisons begin.

#119976

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [72dea7a]

Summary: ✅


AI Review

Summary

Adds synthetic object-storage latency, eight Iceberg performance suites, failpoint lifecycle handling, and dataset cache recovery. Reviewing head 72dea7ab, one Major remains: the compare.sh callers can reuse servers after failed failpoint cleanup, contaminating later measurements.

Findings

⚠️ Majors

  • tests/performance/scripts/perf.py:812: The updated cleanup marker protects CHServer.run_test, but ci/jobs/scripts/perf/compare.sh ignores it in both run_tests (line 563) and the confirmation loop (line 1046). After both disable attempts fail, the runner exits nonzero without teardown-complete, yet these loops continue with the failpoint enabled. Ordinary health probes still succeed, allowing injected latency to distort unrelated comparisons and confirmation results. Reproduced using the actual runner with a mocked driver and the extracted shell loop. Require confirmed cleanup before reuse, stop/restart the servers, or exclude failpoint suites from these paths.
Missing context / blind spots
  • ⚠️ No local ClickHouse binary or Iceberg/S3 fixture was available. Fourteen mocked-driver runner scenarios and suite-discovery checks passed; these validate control flow. A live run with failpoint support on both builds would validate the injected delays and workload execution.
Final Verdict

⚠️ Request changes. Make both compare.sh loops prevent subsequent measurements after unconfirmed failpoint cleanup, and verify that failure path.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 14, 2026
@arsenmuk
arsenmuk changed the base branch from master to arsenmuk/ClickHouse-public-perf-ci-minio-s3 September 14, 2026 13:47
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from 49270c0 to 5ac92d3 Compare September 14, 2026 13:54
arsenmuk added a commit that referenced this pull request Sep 14, 2026
Mark every SYSTEM ENABLE FAILPOINT fill query of the synthetic-IO suites with
do_not_check_in_pr="119976": the reference (left) build predates these
failpoints, so without the attribute the enable fails there, kills the test,
and leaves the failpoints enabled on the new server for the rest of the batch.
With it, perf.py tolerates the reference-side failure and runs the suites on
the new server only, until the failpoints reach the reference builds - then
the attribute becomes inert and real left/right comparisons begin.

#119976

Co-Authored-By: Claude Fable 5 <[email protected]>
@arsenmuk arsenmuk added the pr-performance Pull request with some performance improvements label Sep 14, 2026
@arsenmuk
arsenmuk added this pull request to stack #119988 September 14, 2026 13:56
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-minio-s3 branch from e3a163c to a64fbce Compare September 14, 2026 14:20
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from 5ac92d3 to b5154bc Compare September 14, 2026 14:20
arsenmuk added a commit that referenced this pull request Sep 14, 2026
Mark every SYSTEM ENABLE FAILPOINT fill query of the synthetic-IO suites with
do_not_check_in_pr="119976": the reference (left) build predates these
failpoints, so without the attribute the enable fails there, kills the test,
and leaves the failpoints enabled on the new server for the rest of the batch.
With it, perf.py tolerates the reference-side failure and runs the suites on
the new server only, until the failpoints reach the reference builds - then
the attribute becomes inert and real left/right comparisons begin.

#119976

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 72dea7ab5 with master c7b68329f (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

9 translation units recompiled, 16 s compile time in total, 9 of them have a recent master baseline.

Job report

arsenmuk added a commit that referenced this pull request Sep 15, 2026
Override the perf-CI reference (left) build to the candidate's own PR build,
so master_head compares the candidate against itself. The master_head
reference lacks the s3_slow_*/local_object_storage_slow_* failpoints, so every
synthio query is demoted to the partial (new-server-only) section and gets no
dashboard page. With both servers carrying the failpoints the do_not_check_in_pr
fill queries succeed on both connections, producing real comparison rows,
dashboard pages and flamegraphs for the synthio suites.

Revert before merge.

Related: #119976
Related: #119147
Comment thread ci/jobs/performance_tests.py Resolved
@clickhouse-gh clickhouse-gh Bot added comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). and removed comp-testing Test content only (no production code). labels Sep 15, 2026
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-minio-s3 branch 2 times, most recently from 3796053 to 8b8dab4 Compare October 2, 2026 11:10
@arsenmuk
arsenmuk removed this pull request from stack #119988 October 2, 2026 11:11
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-minio-s3 branch 3 times, most recently from 5dd5423 to 32c9072 Compare October 6, 2026 09:14
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from 664a91e to b5fddf3 Compare October 6, 2026 10:16
@arsenmuk
arsenmuk marked this pull request as ready for review October 6, 2026 10:16
@scanhex12 scanhex12 self-assigned this Oct 6, 2026
throw Exception(ErrorCodes::BAD_ARGUMENTS, "LocalObjectStorage doesn't support append to files");

/// Simulated per-request latency of a slow store, the PUT analogue (once at buffer creation = one upload).
fiu_do_on(FailPoints::local_object_storage_slow_response, { sleepForMilliseconds(simulated_io_latency_ms); });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also to LocalObjectStorage::exists

@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from b5fddf3 to b3ff334 Compare October 9, 2026 09:37
@arsenmuk
arsenmuk marked this pull request as ready for review October 9, 2026 09:40
Comment thread ci/jobs/performance_tests.py Resolved
Comment thread tests/performance/scripts/perf.py Resolved
@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 31 queries analysed

This PR adds perf-test infrastructure: two failpoints that are off by default and add simulated delay to local object storage and S3 HTTP responses, new synthetic-IO Iceberg perf tests, failpoint handling in the perf runner, and CI dataset download logic. ClickBench and TPC-H run on local MergeTree tables and never turn on these failpoints. When a failpoint is off, the check costs almost nothing and is not on these queries' read path. So the flagged improvements on ClickBench Q33/Q34 and TPC-H Q1/Q7 have been downgraded to not sure as noise: all four queries have noisy histories, and Q33/Q34 land inside master's recent range. The not-sure rows Q28, Q30 and Q31 are also within master's normal variation, and none of them can be tied to this diff.

clickbench

⚠️ 5 inconclusive

Flagged queries (5 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 28 not_sure 1055 1002 -5.0% <0.0001 The two tests disagree and the measurements were noisy on both sides. This PR changes no code that this query runs.
⚠️ 30 not_sure 228 251 +10.1% <0.0001 The +10.1% delta is inside master's recent range of 201-287 ms. The PR's new failpoints are off by default and sit outside the MergeTree read path.
⚠️ 31 not_sure 268 298 +11.2% <0.0001 The +11.2% delta is inside master's recent range of 241-337 ms. Nothing in the diff touches the code this query runs.
⚠️ 33 not_sure 1134 977 -13.8% <0.0001 aggregation: The -13.8% change puts the result back inside master's recent range of 962-1202 ms, and the history is noisy. The diff only adds failpoints that are off by default, outside the GROUP BY path.
⚠️ 34 not_sure 1140 984 -13.7% <0.0001 aggregation: The -13.7% change falls within master's recent range of 964-1177 ms, and this query is noisy on master. The PR does not touch aggregation or MergeTree reads.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

⚠️ 2 inconclusive

Flagged queries (2 of 22)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 1 not_sure 65 55 -15.4% <0.0001 The -15.4% change is a 10 ms shift on a fast query with a noisy history. The PR has no code that a TPC-H scan over a local MergeTree table runs.
⚠️ 7 not_sure 81 61 -24.7% <0.0001 The -24.7% change is 20 ms on a noisy query. Joins and MergeTree reads are untouched, and the new failpoints are off in this benchmark.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

Debug info
  • StressHouse run: 94127e24-f226-416e-911f-6da7e3a57a46
  • MIRAI run: 72e6bcca-318e-4455-aaf2-253902727f92
  • PR check IDs:
    • clickbench_1083795_1791823500
    • clickbench_1083801_1791823500
    • clickbench_1083807_1791823500
    • tpch_adapted_1_official_1083817_1791823500
    • tpch_adapted_1_official_1083830_1791823500
    • tpch_adapted_1_official_1083865_1791823501

@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from daa0e6c to 771bddc Compare October 12, 2026 14:39
Comment thread tests/performance/scripts/perf.py Resolved
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch 2 times, most recently from 0e75eac to e221be8 Compare October 15, 2026 12:58
Comment thread tests/performance/scripts/perf.py Resolved
Comment thread ci/jobs/performance_tests.py Resolved
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from e221be8 to 0d9d3d3 Compare October 19, 2026 08:24
Comment thread tests/performance/scripts/perf.py Resolved
@arsenmuk
arsenmuk force-pushed the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch from 0d9d3d3 to 72dea7a Compare October 26, 2026 07:23
Comment on lines +809 to +812
def report_clean():
"""`CHServer.run_test` reuses the servers only after this marker."""
if teardown_clean_result and not enabled_failpoints:
print("teardown-complete")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Honor the cleanup marker in the compare.sh callers too

This protects CHServer.run_test, but ci/jobs/scripts/perf/compare.sh also reuses the servers: run_tests catches a failed runner and continues at lines 563–572, and the confirmation loop does the same at lines 1046–1062. Neither checks teardown-complete.

If an enable succeeds and both disable attempts fail, perf.py now correctly exits nonzero without this marker, but these callers still start another test with the failpoint enabled. A SELECT 1 health probe succeeds on a server with injected storage latency, so it does not trigger a restart. This contaminates subsequent performance comparisons and confirmation results. I reproduced the continuation using the actual run_tests function with the real runner's mocked-driver cleanup-failure output.

Please make both loops stop or restart the servers when cleanup is unconfirmed, or exclude failpoint suites from those paths.

@arsenmuk
arsenmuk added this pull request to the merge queue Oct 28, 2026
Merged via the queue into master with commit b34c829 Oct 28, 2026
178 checks passed
@arsenmuk
arsenmuk deleted the arsenmuk/ClickHouse-public-perf-ci-synth-lags branch October 28, 2026 14:05
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 28, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 4, 2026
libfiu never leaves its slow path once the first failpoint is enabled:
`has_any_failpoint_been_registered` is set by `fiu_enable` and never
reset, so from then on every `fiu_do_on` of the server process takes a
global rwlock and a hash lookup. The perf job runs all the tests of a
shard on the same two servers, so the `iceberg_suite_*_synthio_*` tests
(ClickHouse#119976), which enable `s3_slow_response` or
`local_object_storage_slow_response`, made every test that ran after them
slower and noisier: a 10M-key GROUP BY checks a failpoint per key, and
`removing_group_by_keys` went from 0.1% to 28% of master runs with a
difference over 10% on amd (ClickHouse#100759).

Each of these tests is a twin of an `iceberg_suite_*` test that only adds
the failpoint, so without it they would duplicate the existing tests.
Remove them, together with the `<failpoint>` element of `perf.py` (and
its handling in test discovery and profile collection), which nothing
else uses. The style check now rejects a failpoint in any performance
test, fragment or file they pull in with a `file` attribute (the
`tests/benchmarks` query files), both the element and a
`SYSTEM ENABLE|DISABLE FAILPOINT` statement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov pushed a commit to melvynator/ClickHouse that referenced this pull request Nov 10, 2026
The first `fiu_enable` sets libfiu's `has_any_failpoint_been_registered`,
which is never reset, so every later `fiu_do_on` of the server takes
libfiu's global rwlock and a hash lookup, also after
`SYSTEM DISABLE FAILPOINT`. `Aggregator::drainAdaptivePartition` checks one
per inserted key. The `iceberg_suite_*_synthio_*` tests of ClickHouse#119976 enable a
failpoint, and the job runs all tests of a shard on the same two servers in
name order, so since 2026-10-28 every test sorted after them is measured on
such servers: about 17 tests 1.3-24x slower and noisier on both arches
(`removing_group_by_keys #0` 0.13 -> 1.46 s on amd).

Order the failpoint tests last in the job's test list, in compare.sh's
confirmation reruns and in its standalone `run_tests`. The compare.sh paths
do not measure when the order cannot be computed: the confirmation is
skipped (original verdicts kept) and `run_tests` exits 1.

Related: ClickHouse#100759

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants