Repository navigation
Make LLVM coverage opt-in in pull requests, run the same configurations on arm_binary - #122853
Conversation
…ns on `arm_binary` Pull requests no longer run the LLVM coverage jobs (the coverage build, the `amd_llvm_coverage` stateless, integration and unit test jobs, the `excluded_from_llvm` jobs and the `LLVM Coverage` merge job) unless they have the `ci-coverage` label. They cost about $35k per week, and the coverage gate failed in one pull request out of 2910 in the last month. Instead, pull requests run the same test configurations on the `arm_binary` build: the `s3 storage, DBReplicated`, `ParallelReplicas, s3 storage` and `AsyncInsert, s3 storage` stateless variants and a full integration run in 4 batches. The plain coverage stateless batches and `excluded_from_llvm` need no replacement, because `arm_binary, parallel`/`sequential` already run the whole suite; unit tests already run with ASan, TSan and MSan. The replacements are skipped in the same cases the coverage jobs were (no build-affecting changes), and when `ci-coverage` makes the coverage jobs run. Master is unchanged and keeps running the coverage jobs on every commit.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Workflow [PR], commit [14389ca] Summary: ✅ AI ReviewSummaryThis PR makes LLVM coverage opt-in on pull requests and substitutes the default coverage stateless/integration lanes with Findings❌ Blockers
Final VerdictStatus:
|
| functional_tests_arm_binary_coverage_replacement_pr_jobs = common_ft_job_config.parametrize( | ||
| *[ | ||
| Job.ParamSet( | ||
| parameter=f"arm_binary, s3 storage, DBReplicated, parallel, {batch}/{total_batches}", | ||
| runs_on=RunnerLabels.ARM_MEDIUM_CPU, | ||
| requires=[ArtifactNames.CH_ARM_BINARY], | ||
| ) | ||
| for total_batches in (2,) | ||
| for batch in range(1, total_batches + 1) | ||
| ], | ||
| Job.ParamSet( | ||
| parameter="arm_binary, s3 storage, DBReplicated, sequential", | ||
| runs_on=RunnerLabels.ARM_SMALL, | ||
| requires=[ArtifactNames.CH_ARM_BINARY], | ||
| ), | ||
| Job.ParamSet( | ||
| parameter="arm_binary, ParallelReplicas, s3 storage, parallel", | ||
| runs_on=RunnerLabels.ARM_MEDIUM_CPU, | ||
| requires=[ArtifactNames.CH_ARM_BINARY], | ||
| ), | ||
| Job.ParamSet( | ||
| parameter="arm_binary, ParallelReplicas, s3 storage, sequential", | ||
| runs_on=RunnerLabels.ARM_SMALL, | ||
| requires=[ArtifactNames.CH_ARM_BINARY], | ||
| ), | ||
| Job.ParamSet( | ||
| parameter="arm_binary, AsyncInsert, s3 storage, parallel", | ||
| runs_on=RunnerLabels.ARM_MEDIUM_CPU, | ||
| requires=[ArtifactNames.CH_ARM_BINARY], | ||
| ), | ||
| Job.ParamSet( | ||
| parameter="arm_binary, AsyncInsert, s3 storage, sequential", | ||
| runs_on=RunnerLabels.ARM_SMALL, | ||
| requires=[ArtifactNames.CH_ARM_BINARY], | ||
| ), | ||
| ) | ||
| # The same for the full integration run: all test modules, including the ones the coverage | ||
| # run leaves to `excluded_from_llvm`. | ||
| integration_test_arm_binary_coverage_replacement_pr_jobs = ( |
There was a problem hiding this comment.
These replacements inherit common_ft_job_config / common_integration_test_job_config, but neither digest covers ci/defs/job_configs.py or ci/workflows/pull_request.py. On this PR the Config Workflow result already skips every one of these new jobs as Not affected by the changed files and not required, so a PR that only changes the replacement-job definitions never exercises the jobs it changed. Please extend the digests (or otherwise mark these jobs affected) to the files that define and schedule them.
There was a problem hiding this comment.
Not changing this here: it is how every stateless and integration job works, not something specific to the replacements. None of the existing ones (for example Stateless tests (arm_binary, parallel) or the coverage jobs these replace) has ci/defs/job_configs.py or ci/workflows/pull_request.py in its digest. Adding them to common_ft_job_config / common_integration_test_job_config would rerun all full suites on any job-config edit and change the cache digests of the master jobs too. A PR that changes job definitions can use ci-force-all, which bypasses both the filter hooks and the changed-files filter; this PR now has it.
…erage replacement jobs A pull request that only rewires these jobs in the workflow should run them rather than skip them as unaffected.
| # If only CI scripts changed (no product code), run a minimal set of tests | ||
| # to validate the CI pipeline: stateless batch 1 and amd_asan_ubsan integration batch 1. | ||
| # The whole coverage family is already skipped above whenever the build is | ||
| # unaffected, so this only narrows down the plain (non-coverage) test jobs. | ||
| # The coverage family and its `arm_binary` replacements are already handled above, | ||
| # so this only narrows down the other plain (non-coverage) test jobs. |
There was a problem hiding this comment.
This branch still catches the new coverage paths on CI-scripts-only PRs. A concrete trace against the current should_skip_job shows that with changed_files = ['ci/workflows/pull_request.py'], Integration tests (arm_binary, 1/4) returns Skipped: only CI scripts changed; running amd_asan_ubsan integration batch 1 only, so the replacement full integration run never validates a workflow-only change. With the same changed file set plus the ci-coverage label, Integration tests (amd_llvm_coverage, 1/8) is also skipped by this branch while LLVM Coverage itself is still runnable, which turns the opt-in path into a partial measurement instead of the full coverage run the new label promises. Please exempt COVERAGE_REPLACEMENT_JOBS and the opted-in coverage shards from this generic CI-only narrowing.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
`ARM_MEDIUM_CPU` (c8g.8xlarge) has 32 vCPU and 64 GiB, twice the cores of the coverage runner with the same memory. The stateful data load in `Stateless tests (arm_binary, AsyncInsert, s3 storage, parallel)` exceeded the 25 GB query memory limit there. `ARM_MEDIUM` (m8g.4xlarge, 16 vCPU, 64 GiB) matches the coverage runner.
With `parallel_replicas_local_plan = 0` the local replica is queried like a remote one. In `Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)`, 107 of the 116 failures with printed settings had it at `0` (50% expected), mostly tests asserting on the plan or the logs of the local part. Keep the default `1`, as `adjust_settings_for_autopr` already does. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122853&sha=ec896d3cdcb1f79f80021244714eebe4ff779fc9&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29
| return True, f"Skipped, labeled with '{Labels.CI_NO_COVERAGE}'" | ||
| return True, "Skipped: no build-affecting changes; coverage would be identical to master" | ||
| if _info_cache.pr_number > 0: | ||
| if Labels.CI_COVERAGE not in _info_cache.pr_labels: |
There was a problem hiding this comment.
ci-coverage only changes the later should_skip_job hook, but Config Workflow can filter these jobs out before that hook ever runs. A concrete trace against _filter_unaffected_jobs on changed_files = ['ci/workflows/pull_request.py'] or ['ci/jobs/scripts/workflow_hooks/filter_job.py'] still marks Build (llvm_coverage_build), every amd_llvm_coverage shard, LLVM Coverage, and the new arm_binary replacement jobs as Not affected by the changed files and not required. So a PR that changes only the coverage pipeline and adds ci-coverage still gets no coverage run unless the author also knows to add ci-force-all, which breaks the new opt-in contract introduced here. Can we either teach the config-time changed-files filter about coverage-pipeline paths / ci-coverage, or give the relevant coverage and replacement jobs a narrow digest override for those paths?
`02156_storage_merge_prewhere`, `02402_merge_engine_with_view` and `02918_optimize_count_for_merge_tables` pass with parallel replicas: in the last 30 days they were reported `NOT_FAILED` about 9870 times and failed 2-6 times in the `ParallelReplicas` stateless jobs. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122853&sha=ec896d3cdcb1f79f80021244714eebe4ff779fc9&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29
| "max_parsing_threads": lambda: random.choice([0, 1, 10]), | ||
| "optimize_functions_to_subcolumns": lambda: random.randint(0, 1), | ||
| "parallel_replicas_local_plan": lambda: random.randint(0, 1), | ||
| # `parallel_replicas_local_plan` is not randomized: it stays at its default `1`. With `0`, the local |
There was a problem hiding this comment.
This turns off parallel_replicas_local_plan randomization for every functional lane, not just the new ParallelReplicas replacement job. A few existing plan-based PR tests explicitly rely on CI randomizing this setting so they exercise both plan modes over time (04836_pr_plan_based_in_subquery_distributed, 05137_pr_plan_based_in_subquery_unserializable_source, 05139_pr_plan_based_in_subquery_join_on); after this change they only ever see the default 1.
Because the failures here are specific to the --no-parallel-replicas configuration, can we pin parallel_replicas_local_plan = 1 only for that lane (for example via args.no_parallel_replicas) instead of deleting the randomization globally?
With parallel replicas, `optimize_aggregation_in_order = 1` makes `canUseProjectionForReadingStep` reject every projection, including the implicit `_minmax_count_projection` behind trivial `count()`. In the `arm_binary, ParallelReplicas` run 17 of the 18 failures with printed settings had it at `1`.
All three fail the main pass of every `Stateless tests (*, s3 storage, DBReplicated, sequential*)` run. On master this is hidden: the diagnostics rerun drops `--replicated-database`, the rerun passes, and llvm_coverage jobs report `flaky` as `OK` (340/340, 340/340 and 129/129 whitewashed rows in 7 days, 0 clean, 0 red). They are visible on the new lane of ClickHouse#122853: https://github.com/ClickHouse/ClickHouse/actions/runs/36622581675/job/109632143373 05229 and 05230 edit one replica's ZooKeeper nodes by the table's literal path. A Replicated database rewrites explicit engine arguments without macros to `<path>/auto_{shard}` and `<replica>auto_{replica}` (`_functional_tests_helper_database_replicated_replace_args_macros`), so the `rm`/`ls`/`create` calls print `No node` and every assertion reads 0. Every arm depends on that path, so both files get `no-replicated-database`, like the other tests that edit a table's nodes by a literal path. 05260 filters `system.query_log` with `log_comment LIKE '05260\_%'`, which also matches the test's default log comment. Under a Replicated database the DDL worker replays `CREATE TABLE t_dist_pd` as a secondary query carrying that comment, which adds one row. The filter now lists the three log comments the test sets, as `05104_distributed_ast_push_down_under_not` does. 04741_cancel_skip_index_marks_remote_read fails on the same lane because a lightweight `UPDATE` runs on every replica of a shard (ClickHouse#122285). ClickHouse#122393 fixes that, so the test is not touched here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The coverage variant jobs never failed these, because the diagnostics rerun runs without `--replicated-database` and the coverage jobs report a test that passed the rerun as `OK`. The `arm_binary` jobs show them. Parallel replicas: - `01508_partition_pruning_long_1`, `01508_partition_pruning_long_2`: `long`, never run with parallel replicas before, fail deterministically, so they go to `parallel_replicas_blacklist.txt`. - `04029_join_convert_to_fixed_hash_table`, `02499_monotonicity_toUnixTimestamp64`: assert on `text_log` or `read_rows` of the initial query, which parallel replicas split across replicas. - `04885_enum_empty_label_json_subcolumn_index`: #119745 Replicated database: - `03636`, `04541`, `04626`, `05059_mergeTreeCodecBlockCounts_access`, `05060`: #111561, the same way the sibling access tests are tagged. - `05211_aggregate_parameter_type_name_round_trip`: #123031 - `04825_quantile_deterministic_alter_add_modify_column`: #123032 - `04741_cancel_skip_index_marks_remote_read`: #122285 - `4061_truncate_many_dedup_blocks`: its explicit Keeper path gets `/auto_{shard}` appended. - `05256_s3_uri_exception_masks_credentials`: count only the initial query, the replicated database DDL worker logs a second row for the `CREATE`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=122853&sha=a0a0d733f83e9dcbb565981be313272909ec2571&name_0=PR
| SELECT type, position(exception, 'SECRET_') > 0 AS leaked, extract(exception, 'DB::Exception: (.*)\\. \\(BAD_ARGUMENTS\\)') AS message | ||
| FROM system.query_log | ||
| WHERE current_database = currentDatabase() AND type != 'QueryStart' AND exception_code = 36 | ||
| WHERE current_database = currentDatabase() AND is_initial_query AND type != 'QueryStart' AND exception_code = 36 |
There was a problem hiding this comment.
Filtering system.query_log down to is_initial_query weakens this regression precisely on the replicated-database path that motivated the change. The DDL worker replay is another user-visible query_log row for the same secret-bearing CREATE, so if that path ever reintroduced an unmasked URI this test would now stay green.
Can we keep non-initial rows in scope and deduplicate or aggregate the duplicated CREATE rows instead, so the test still proves that every logged exception masks the credentials?
alexbakharew
left a comment
There was a problem hiding this comment.
ci-coverage was reverted. #119043
ci-force-all is a correct one
Edited by the nightly changelog CI job following .claude/skills/edit-changelog/SKILL.md. Changelog-revert: 123508 114437 Revert "Refuse Iceberg data compaction until it can publish its result" Changelog-revert: 123789 122853 Revert "Make LLVM coverage opt-in in pull requests, run the same configurations on arm_binary" Changelog-deleted-entry: 114437 [Improvement] [section] * In the open-source build, `Iceberg` data compaction (`OPTIMIZE TABLE` with `allow_experimental_iceberg_compaction = 1`) now reports `NOT_IMPLEMENTED` instead of running, because it deleted files that retained snapshots still referenced, including `version-hint.text` and every `vN.metadata.json`, which left the table unreadable and could permanently lose an acknowledged snapshot's rows. `OPTIMIZE TABLE ... MANIFEST`, `expire_snapshots`, and `remove_orphan_files` are unaffected. [#114437](#114437) ([Groene AI](https://github.com/groeneai)). Changelog-deleted-entry: 122853 [NOT FOR CHANGELOG / INSIGNIFICANT] [raw] * Make LLVM coverage opt-in in pull requests, run the same configurations on arm_binary. [#122853](#122853) ([Nikita Fomichev](https://github.com/fm4v)).
`Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)` runs on every PR since ClickHouse#122853, and five TimeSeries tests fail there on unrelated PRs (CIDB, that job, since 2026-09-29, 147 runs): 05213 51, 05218 26, 05237 10, 05059 6, 04838 4. Both failure classes are the open defects of the TimeSeries table functions on parallel replicas: - the argument of `timeSeriesSamples` / `timeSeriesMetricFamilies` is sent to the replicas as it was written, and a parallel-replica connection carries no default database, so a replica looks the table up in `default` (`UNKNOWN_TABLE`; 05213, 05218, 05237). With the default `parallel_replicas_local_plan = 1` this is a race, which is why it is intermittent; - no replica announces its parts to the coordinator, so every replica reads the whole inner table and each row of `timeSeriesTags` comes back once per replica (05059, 04838, which already pass the database explicitly). Same change as 0bc5beb made for 05057: the `no-parallel-replicas` tag plus one line naming the defect. The engine fix is ClickHouse#118518, which should drop these tags when it lands. Related: ClickHouse#118130 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…over distributed queries `medianDeterministicMerge(state)` over `remote()`, a `Distributed` table or parallel replicas returned a split-dependent result (486416 instead of 492708 for the query of ClickHouse#122935), and a `GROUP BY` of `medianDeterministic` over `remote()` failed with `Skip degree in quantileDeterministic state is 136, which exceeds the maximum value of 31`. Both are writes of a state at a version other than the one announced for the peer: - `AggregateFunctionMerge` forwarded `isVersioned` and `getDefaultVersion` but not `getVersionFromRevision`, so `NativeWriter` derived version 0 for every `-Merge` intermediate state and the reservoir's skip degree was dropped. The forward is gated on the new revision 54493: 26.8 and 26.9 (revision 54492) send `-Merge` states at version 0 without announcing a version, and an ungated forward makes a new initiator read one byte too many per state from them (measured against 26.9.6.6: `UNKNOWN_CODEC`). - `ColumnBLOB::toBLOB` (parallel block marshalling) serialized with the local type's version while `NativeWriter::write` announced the revision-derived one. Both now go through `NativeWriter::setAggregateFunctionStateVersions`. A newly declared `-Merge`-typed column now gets the current state version pinned at `CREATE`, like a column of the function itself, so it keeps the skip degree in storage; existing tables keep version 0. Closes ClickHouse#122935. CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122853&sha=ec896d3cdcb1f79f80021244714eebe4ff779fc9&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 PR: ClickHouse#122853 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er-test coverage Since ClickHouse#122853, pull requests skip the LLVM coverage family by default. The `arm_binary` replacement jobs do not cover two groups of tests. The gtest suites under `#if !defined(SANITIZER)` are compiled only into a plain build: `DateLUTImpl` (7799 cases) and `AllocationInterceptors`. The only plain unit-test job was `Unit tests (amd_llvm_coverage)`. `Build (amd_debug)` already builds `unit_tests_dbms`. Export it as `UNITTEST_AMD_DEBUG` and run it in the new `Unit tests (amd_debug)` job in pull requests, master and release branches. The cases under `#ifndef DEBUG_OR_SANITIZER_BUILD` still run only in the coverage job. `test_ytsaurus` skips itself on ARM and is in `LLVM_COVERAGE_SKIP_PREFIXES`. In pull requests only `Integration tests (amd_binary_excluded_from_llvm)` ran it, and that job is part of the skipped family. The per-test coverage job applied the same skip list, so the module had no rows in `checks_coverage_lines` and the targeted amd jobs could never select it. Run it in the per-test coverage job (`PER_TEST_COVERAGE_KEEP_PREFIXES`). The full coverage shards and `excluded_from_llvm` are unchanged. In the last 14 days, 1855 pull requests ran `Unit tests (asan_ubsan)` and 12 ran `Unit tests (amd_llvm_coverage)`. Of 1574 master-based pull requests, 49 ran `test_ytsaurus` through the submodule-bump TSan jobs, 4 with `ci-coverage`, and 1 because it changed the YTsaurus code. ClickHouse#123671 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Pull requests no longer run the LLVM coverage jobs by default. They become opt-in with the
ci-coveragelabel, and the same test configurations run on thearm_binarybuild instead. Master is unchanged and keeps running the coverage jobs on every commit.Why: the PR coverage jobs cost about $35k per week (CIDB, 2026-09-21 to 2026-09-27, on-demand prices: ~$17k stateless, ~$18k integration), and the coverage build runs the same tests about 2.5 times slower than
amd_debug. Their result is rarely used: incoverage_ci.coverage_datafor 2026-08-29 to 2026-09-29, the coverage gate failed in one pull request out of 2910 (and that one had 99.7% of its changed lines covered). The coverage runs also use--no-random-settings --no-random-merge-tree-settings --no-long, so a plain binary running the same configurations with randomization tests more, not less.What changes in the PR workflow:
ci-coverage:Build (llvm_coverage_build),Stateless tests (amd_llvm_coverage, ...)(plain batches and thes3 storage, DBReplicated,ParallelReplicas, s3 storage,AsyncInsert, s3 storagevariants),Integration tests (amd_llvm_coverage, N/8),Unit tests (amd_llvm_coverage), theamd_binary_excluded_from_llvmjobs andLLVM Coverage. With the label they run as before, also on tests-only pull requests.arm_binaryjobs replace them:Stateless tests (arm_binary, s3 storage, DBReplicated, parallel, 1/2 and 2/2),(arm_binary, s3 storage, DBReplicated, sequential),(arm_binary, ParallelReplicas, s3 storage, parallel/sequential),(arm_binary, AsyncInsert, s3 storage, parallel/sequential);Integration tests (arm_binary, 1/4 .. 4/4), a full run of all modules, including the ones the coverage run leaves toexcluded_from_llvm.excluded_from_llvm:Stateless tests (arm_binary, parallel/sequential)already run the whole suite. Unit tests already run with ASan, TSan and MSan;arm_binaryis built without unit tests.ci-coveragemakes the coverage jobs run.PromQL Compliancealso waits for the new integration jobs, which run the compliance suite.The
ci-coveragelabel already exists; its description is updated to the new meaning..github/workflows/pull_request.ymlwas regenerated withpython3 -m ci.praktika yaml;master.ymldoes not change.The variant configurations have not run with randomized settings and
longtests since March. The first runs showed these problems, all fixed here:ARM_MEDIUM_CPU(c8g.8xlarge, 32 vCPU, 64 GiB); the stateful data load exceeded the 25 GB query memory limit there. They now run onARM_MEDIUM(m8g.4xlarge, 16 vCPU, 64 GiB), the same shape as the coverage runners.ParallelReplicashad 129 failures. 107 of the 116 with printed settings had the randomizedparallel_replicas_local_plan = 0(50% expected), which breaks tests that assert on the plan or logs of the local replica.tests/clickhouse-testno longer randomizes it; it stays at its default1, asadjust_settings_for_autopralready forces.optimize_aggregation_in_order = 1(randomized at 50%) makescanUseProjectionForReadingStepreject every projection under parallel replicas, including the implicit_minmax_count_projectionbehind trivialcount(); 17 of the 18 remainingParallelReplicasfailures with printed settings had it.tests/clickhouse-testno longer randomizes it in theParallelReplicasconfiguration.automatic_parallel_replicas_mode = 2(randomized at 25%) only collects statistics and never switches to parallel replicas, so a quarter of theParallelReplicastests ran without them, and blacklisted tests that fail on every master coverage run came outNOT_FAILEDat random.tests/clickhouse-testno longer randomizes it in theParallelReplicasconfiguration.--replicated-database, and the coverage jobs report a test that passed the rerun asOK, so on master everyDBReplicatedrun of them is a hidden failure. They are taggedno-parallel-replicas/no-replicated-databasewith the reason and the issue,01508_partition_pruning_long_{1,2}(deterministic) go toparallel_replicas_blacklist.txt, and05256_s3_uri_exception_masks_credentialsnow counts only the initial query.Real bugs found by these runs are filed separately:
Related: #122935
Related: #122936
Related: #123031
Related: #123032
Related: #123061
Related: #111561
Related: #119745
Related: #122285
Related: #112642
Related: #123323
Related: #122754
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/122853]
Version info
26.10.1.1392-master(included in26.10and later)