Repository navigation
Conversation
…etree `ALTER TABLE ... DETACH PARTITION 1` covers the inserted part with a new empty part `1_1_1_1`. It is built from the covered part's columns, so it still has column `c` (the test drops `c` only afterwards). `clearEmptyParts` outdates it in memory only, and it stays on disk for `old_parts_lifetime` (480 s). Every `local_query` is a separate `clickhouse-local` process over the same path, and each one loads `1_1_1_1` as an active part again. At startup `clearEmptyParts` hides it, but not while outdated parts are still loading asynchronously (the guard from ClickHouse#98698). The `DELETE` leaves the outdated `1_3_3_0` on disk, so from then on every process keeps `1_1_1_1` active until the pending mutations rewrite it in the background. When that rewrite has not committed before the `system.parts_columns` query, the query sees `c` and the test prints `the rewrite dropped the column: 1` (seen in `Stateless tests (arm_binary, parallel)` and `Fast test`). Set `old_parts_lifetime = 0` for the test table, so the empty part is removed from disk inside the `DETACH PARTITION` statement and no later process can load it. 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; 1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261027-083000 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261027-072500 |
|
Workflow [PR], commit [1033610] Summary: ✅ AI ReviewSummaryPR #127925 sets Final VerdictStatus: ✅ Approve. |
|
cc @tiandiwonder, could you review this and add the |
CI finish ledger - 1033610Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
CIDB has no other Session id: cron:our-pr-ci-monitor:20261027-193015 |
86fbe53
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Related: #120817 (adds the test), #121121 (reported there).
The test printed
the rewrite dropped the column: 1instead of0, twice on the same master base: Stateless tests (arm_binary, parallel) and Fast test.Root cause:
DETACH PARTITION 1covers1_1_1_0with an empty part1_1_1_1that still has columnc(it is built beforeDROP COLUMN c). It is outdated only in memory and stays on disk forold_parts_lifetime(480 s), so every laterclickhouse-localprocess loads it as active. StartupclearEmptyPartshides it, except while outdated parts are still loading, which is the case from theDELETEon (1_3_3_0stays on disk). So after theDELETE,1_1_1_1is active until the pending mutations rewrite it in the background; if that rewrite has not committed before thesystem.parts_columnsquery, the test seesc.Change:
old_parts_lifetime = 0for the test table, so1_1_1_1is removed from disk inside theDETACH PARTITIONstatement. Test only.Validation, local debug build of the failing base:
1_1_1_1withcis on disk in 20/20 runs before, 0/20 after;1in 20/20 runs before,0in 20/20 after;amd_binary. The race itself did not reproduce locally (0 of 4884 runs of the unmodified test).On a server the cleanup thread hides such a part right after outdated parts finish loading; only short-lived
clickhouse-localprocesses hit the window, so the engine is unchanged.Workflow [PR]
Sync PR [sync-upstream/pr/127925]
Version info
26.11.1.850-master(included in26.11and later)