Repository navigation
Fix CI failures in PGO/BOLT profile collection workflow - #105477
Merged
Merged
Conversation
`Collect PGO profiles` failed on master because the freshly-started PGO-instrumented `clickhouse-server` did not respond to `select 1` within the 30-attempt × 2 s = 60 s readiness window in `configure_datasets` / `start_server`. PGO instrumentation slows startup considerably (every instrumented site bumps a counter), so a 60 s window is too tight for a cold start. https://github.com/ClickHouse/ClickHouse/actions/runs/26190353268/job/77057127893 Job report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=31cab7e9b5059f3a9aee1f6a9edf24d322d9cd16&name_0=OptimizeClickHouse&name_1=Collect%20ClickHouse%20Profiles%20%28PGO%2C%20BOLT%29%20%28amd64%29 The job log carried only a wall of `Run command [... select 1]` retries — the server's own log (`preconfig.log` / `server.log`) was written inside `perf_wd/pgo_server/` and was not uploaded as a job artifact, so the underlying reason was invisible. Two changes: * Extract the readiness loop into `wait_for_server_ready`, switch from a fixed retry count to a wall-clock deadline of 600 s, and notice an early process exit during the wait (not just in the first 2 s). * On readiness failure or premature process exit, dump the tail of the server log to stdout via a new `dump_log_tail` helper, so the next failure can be diagnosed from the CI job log alone. Polling is also made quiet, with a 30 s heartbeat, to avoid hundreds of identical `Run command` lines in the longer window.
Contributor
|
Workflow [PR], commit [bb7d3fe] Summary: ✅ AI ReviewSummaryThis PR extends server readiness waiting for PGO/BOLT profile collection and adds server-log tail dumps on startup failure. The timeout and diagnostics changes are useful, but the promised quiet polling behavior is not implemented in the current code, so this should not merge yet. Findings
Final Verdict
|
| # Polling is intentionally quiet — at one attempt every 2s a 10-minute | ||
| # window would otherwise produce hundreds of identical `Run command` | ||
| # lines; emit a progress heartbeat every 30s instead. | ||
| res, out, _ = Shell.get_res_stdout_stderr( |
Contributor
There was a problem hiding this comment.
Shell.get_res_stdout_stderr defaults verbose=True, so this call still prints Run command [...] on every 2-second probe. With a 600-second timeout that can produce ~300 noisy lines, so the intended quiet polling + 30-second heartbeat does not actually happen. Please pass verbose=False here.
This was referenced May 21, 2026
DavidHe-2008
pushed a commit
to DavidHe-2008/ClickHouse
that referenced
this pull request
Jun 1, 2026
Extend server-readiness timeout in PGO/BOLT profile collection
pull Bot
pushed a commit
to CrazyForks/ClickHouse
that referenced
this pull request
Jun 19, 2026
The `OptimizeClickHouse` workflow (`Collect ClickHouse Profiles (PGO, BOLT)`) failed on both architectures. amd64: the PGO-instrumented `clickhouse-server` segfaulted on startup right after `Will remap executable in memory.`. The perf-comparison config `zzz-perf-comparison-tweaks-config.xml` force-enables `remap_executable`, and remapping the `.text` segment of the instrumented, non-self-extracting binary crashes it. Strip the setting from the copied configs before launching the server; the default `false` is what profile collection wants (remapping to huge pages is an irrelevant micro-optimization here). aarch64: the job hit the 8h timeout having run only 44 of 447 perf tests. The instrumented binary is several times slower than a release build, individual tests ran for tens of minutes, and passing `--max-queries 0` for the benchmark files ran *all* of their queries. Profile collection is now strictly time-bounded: * each pass gets a wall-clock budget, clamped at run time to the time actually left in the job (via `collection_budget`) so a slow build cannot push collection past the hard kill, after which nothing is uploaded; * each test runs under a hard `timeout` so one heavy test cannot stall a pass; * `--max-query-seconds` / `--prewarm-max-query-seconds` cap per-query time; * `--runs` is reduced (collection only needs to exercise code paths). Tests skipped once a budget is exhausted are logged, never silently dropped. Failing run: https://github.com/ClickHouse/ClickHouse/actions/runs/26215735471 Workflow: https://github.com/ClickHouse/ClickHouse/actions/workflows/optimize_clickhouse.yml Related: ClickHouse#100938 Related: ClickHouse#105477 Co-Authored-By: Claude Opus 4.8 (1M context) <[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.
Two CI failures in the new
OptimizeClickHouseworkflow (PR #100938) on master.1.
Collect PGO profilestimes out without diagnostic (amd64)The freshly-started PGO-instrumented
clickhouse-serverdid not respond toselect 1within the 30-attempt × 2 s = 60 s readiness window inconfigure_datasets/start_server. PGO instrumentation slows startupconsiderably (every instrumented site bumps a counter), so a 60 s window is too
tight for a cold start. The job log carried only a wall of
Run command [... select 1]retries — the server's ownpreconfig.log/server.logis writtenunder
perf_wd/pgo_server/and is not uploaded as an artifact, so the actualreason was invisible.
Failed run:
Fix in
ci/jobs/collect_clickhouse_profiles.py:wait_for_server_ready, switch from a fixedretry count to a wall-clock deadline of 600 s, and notice premature process
exit during the wait (not just in the first 2 s).
log to stdout via a new
dump_log_tailhelper.the log with
Run commandlines.2.
Build (BOLT)fails on PGO profile hash mismatches under-Werror(aarch64)After fix 1 landed and PGO collection now succeeds, the next stage
Build (BOLT)fails because clang's PGO backend emits
-Wbackend-plugin:for several functions (
ConcurrencyControl.cpp,Dwarf.cpp,Exception.cpp),and the project-wide
-Werrorturns these into hard build failures.Failed run:
The instrumented build is required to disable ThinLTO (the cmake check
in
profile_optimization.cmakeenforces this — clang IR instrumentation isincompatible with ThinLTO), while the BOLT build enables ThinLTO. ThinLTO can
perturb individual function bodies before profile matching, so a non-zero number
of hash mismatches is expected. The compiler simply discards the stale counts
for those functions, which is the correct best-effort behaviour.
Fix in
cmake/profile_optimization.cmake: add-Wno-error=backend-pluginalongside the
-fprofile-use=...flags so the mismatches remain visible aswarnings without aborting the build.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.5.1.919