Skip to content

Perf CI: remove the parts the hits rebuild replaces before the tests start - #131429

Merged
m7kss1 merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-rebuild-remove-outdated-parts
Nov 24, 2026
Merged

m7kss1 merged 1 commit into
ClickHouse:masterfrom
groeneai:perf-rebuild-remove-outdated-parts

Conversation

@groeneai

@groeneai groeneai commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129975

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):

Not required: CI-only change.

Description

Performance Comparison (arm_release, master_head) PR shards fail with codecs_float_insert ... Code: 243. Cannot reserve 8.48 MiB, not enough space (#129975, 6/6); 4 jobs on 3 unrelated PRs since 2026-11-11.

The Populate step rebuilds the hits datasets with a 16-thread INSERT ... SELECT and OPTIMIZE FINAL. Every part that the merges replace stays on disk as Outdated for old_parts_lifetime (480 s), and is then removed only at the next pass of the table's cleanup thread, which sleeps up to max_cleanup_delay_period (300 s). In that job both servers still held about 71 GiB of such parts when the tests started (27.5 GiB free), codecs_float_insert used up the rest, and the first replaced parts were removed 15 seconds after it failed.

rebuild_table now sets old_parts_lifetime = 0 on the table it builds, and after OPTIMIZE FINAL runs SYSTEM START CLEANUP until system.parts lists no part of the table outside Active (bounded by 120 s; a timeout fails Populate, like the other statements there). The setting is reset together with use_const_adaptive_granularity, so the final table definition is unchanged.

Validated locally by calling rebuild_table on a 30M-row table, in place and cross name: before, it returned with 33 Outdated parts (455 MB, 9.5x the live data) on disk; after, with none, removed within 0.1 s of OPTIMIZE FINAL, adding about a second. Without the setting the new wait times out, so its check can fail.


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

Version info

  • Merged into: 26.12.1.400-master (included in 26.12 and later)

…start

The Populate step rebuilds the hits datasets with a 16-thread INSERT and
OPTIMIZE FINAL. The parts that the merges replace stay on disk for
old_parts_lifetime (480 s) and are removed only at the next pass of the
table's cleanup thread, which sleeps up to max_cleanup_delay_period (300 s).
So both servers start the tests with about 71 GiB of replaced parts on the
shared disk, and codecs_float_insert fails with "Cannot reserve 8.48 MiB,
not enough space":
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129975&sha=087475f62ba2fbadcf15166ee3bcb35996667270&name_0=PR&name_1=Performance%20Comparison%20%28arm_release%2C%20master_head%2C%206%2F6%29

Set old_parts_lifetime = 0 on the rebuilt table, wake its cleanup thread
after OPTIMIZE FINAL until system.parts lists no non-Active part (120 s
bound, a timeout fails Populate), and reset the setting with
use_const_adaptive_granularity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

Gate B (second model, cold) and my own review of 138d361b5e96: no blocker, no major.

Finding Verdict
💡 The local copy of rebuild_table in .claude/skills/double-check-perf-tests/double_check_perf.py keeps the 480 s lifetime. Not changed here: it runs in no CI job, and this PR fixes the CI job only.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Calling the unmodified rebuild_table on a local server (30M-row MergeTree table, in place and cross name) returns with 33 Outdated parts (455 MB) on disk every time; 2/2 cases.
b Root cause explained? Parts replaced by the rebuild's merges stay on disk for old_parts_lifetime (480 s) plus up to one 300 s cleanup sleep, so Populate ends with about 71 GiB of them and the next write-heavy test (codecs_float_insert) runs out of disk.
c Fix matches root cause? Yes. The rebuild removes the parts it replaced before returning, through the table's own cleanup (old_parts_lifetime = 0 + SYSTEM START CLEANUP); no test, bound or disk size is changed.
d Test intent preserved / new tests added? CI-script change: no test of the test infrastructure. Validated locally (rows a, e).
e Both directions demonstrated? Yes. Before: 33 Outdated parts, 455 MB. After: 0, 681 bytes, removed 0.1 s after OPTIMIZE FINAL. Without the setting the wait times out after 120 s and raises.
f Fix is general across code paths? Yes. All three rebuilt tables (hits_10m_single, hits_100m_single, test.hits) go through rebuild_table, on both servers.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no data types involved). Both table-name shapes (in place, cross name) were exercised.
h Backward compatible? (maintainer-approved exception only) Yes. The statements also run on 25.3; the setting is reset, so the final table definition is unchanged.
i Invariants and contracts preserved? When Populate returns, no rebuilt table has non-Active parts. Failing statements and the timeout raise, so Populate fails instead of starting the tests with the old parts on disk.

Session id: cron:clickhouse-impl-slot-40:20261113-200600

@clickhouse-gh

clickhouse-gh Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [138d361]

Summary: ✅


AI Review

Summary

The PR temporarily sets old_parts_lifetime = 0 while rebuilding performance datasets, wakes cleanup, and waits for all non-Active parts to disappear before resetting the setting and starting benchmarks. Reviewed head 138d361b5e96287c83bc855264d1251d52824cb0; no blockers or majors found. The documented before/after reproduction covers both rebuild paths and timeout failure.

Missing context / blind spots
  • ⚠️ This checkout has no ClickHouse binary or build, so the author's live-server validation was not independently repeated. The head's performance report contains no executed test results; a completed performance shard would provide CI-scale confirmation.
Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Nov 13, 2026
@m7kss1 m7kss1 self-assigned this Nov 24, 2026
@m7kss1
m7kss1 added this pull request to the merge queue Nov 24, 2026
Merged via the queue into ClickHouse:master with commit cd11f22 Nov 24, 2026
410 of 411 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 24, 2026
groeneai pushed a commit to groeneai/ClickHouse that referenced this pull request Nov 25, 2026
The `Tests` stage of the performance comparison job prints the free space
of the filesystem that holds `perf_wd` before every test. Both servers
store their data there, so a `Cannot reserve ..., not enough space`
failure can be traced to what was free when the test started.

Related: ClickHouse#131429

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

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). manual approve Manual approve required to run CI pr-ci 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