Repository navigation
Use a fixed insert time in the storage memory check scenarios - #128485
Conversation
`02_insert_data.sql` filled `created` with `now() - INTERVAL number SECOND` for 100000 rows (a 27.8 h span), and `test_mt` is partitioned by `toYYYYMM(created)` in the job's Europe/Amsterdam time zone. During the first 27.8 hours of every month the rows therefore spanned two months: two partitions and two parts instead of the single part the scenario intends. With two partitions `OPTIMIZE FINAL` merges them in parallel and the mutations of 03 and 04 run one task per part, so ZSTD compressions overlap and draw contexts from the shared per-CPU pools. Which pooled context (and workspace size) serves which block then depends on scheduling, so the live ZSTD workspace bytes at a checkpoint differ between the master and the PR run by one size step (12 KB to 47 KB) and stay live after `09_cleanup.sql`. On 2026-11-01 this failed unrelated PRs on 02/03/04/05/09; the 02 baseline also moves from ~26 KB to ~980 KB inside the window (seen on 2026-10-01 too). A fixed mid-month instant keeps all rows in one partition in any time zone, because the literal and the partition key are evaluated in the same session time zone. 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 findings, the same 2 again on a re-run against the final PR text).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261101-144400 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261101-123343 |
|
cc @qoega, could you review this and add the |
|
Workflow [PR], commit [5d45260] Summary: ✅ AI ReviewSummaryPR #128485, reviewed at Missing context / blind spots
Final VerdictStatus: ✅ Approve. No required changes. |
508442d
Related: #128329
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
Storage memory checkscenarios insert a fixed time instead ofnow(), so the check no longer fails unrelated PRs at the start of every month.Description
Storage memory checkfails unrelated PRs during the first 27.8 hours of every month. Between 2026-10-31 23:00 and 2026-11-01 14:00 UTC, 6 PRs went red on02,03,04,05or09by 12 to 47 KB of ZSTD workspace (ZSTD_resetCCtx_internal > ZSTD_cwksp_create), e.g. #128329 (02, 09) and another PR (04, 05, 09).02_insert_data.sqlinsertedcreated = now() - INTERVAL number SECONDfor 100,000 rows (27.8 h), andtest_mtisPARTITION BY toYYYYMM(created)in the job'sEurope/Amsterdamtime zone. Near the start of a month the rows span two months, so the table gets two partitions instead of the single part the scenario intends.OPTIMIZE FINALthen merges them in parallel and the 03/04 mutations run one task per part, so ZSTD compressions overlap, and which pooled context (with which workspace size) serves which block depends on scheduling. The difference stays live after09_cleanup.sql. Inside this window the02baseline also moves from ~26 KB to ~980 KB on both arms.The scenario now inserts a fixed mid-month time. The literal and the partition key are evaluated in the same session time zone, so all rows land in one partition in any time zone.
Validated locally with a debug
clickhouse-examplesand the job's own analysis helpers: the unfixed02at the 2026-11-01 job time gives partitions 202610 and 202611, the fixed one gives a single202601partition under Europe/Amsterdam, UTC, Pacific/Kiritimati and Pacific/Pago_Pago. Over 30 profiler runs per variant, the fixed per-scenario medians equal the out-of-window ones (02: 25,084 vs 25,080 B; in-window 1,107,696 B).Workflow [PR]
Sync PR [sync-upstream/pr/128485]
Version info
26.11.1.1347-master(included in26.11and later)