Skip to content

Fix Upgrade check errors from the empty part left by DETACH PART in 04653 - #125293

Merged
PedroTadim merged 2 commits into
ClickHouse:masterfrom
tiandiwonder:fix-04653-revived-empty-part
Nov 12, 2026
Merged

PedroTadim merged 2 commits into
ClickHouse:masterfrom
tiandiwonder:fix-04653-revived-empty-part

Conversation

@tiandiwonder

@tiandiwonder tiandiwonder commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #120975
Related: #118499

Upgrade check (amd_release) fails on its server log scan with a burst of UNKNOWN_IDENTIFIER errors from MutatePlainMergeTreeTask, all from t_stale_part_type_5 in 04653_mutation_rewrite_stale_part_column_type. Example: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118242&sha=28503f108eeecbd23581117b0f8117a33fd3e8ce&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 (PR #118242).

DETACH PART leaves an empty part covering the detached one, with the column list from before the RENAME COLUMN b TO d. Cleanup outdates it right away, but its directory stays on disk for old_parts_lifetime. When the upgrade check restarts the server within that time, the part is loaded as active, mutation scheduling picks it up before clearEmptyParts may run, and the mutation fails on b until cleanup drops the part.

Setting old_parts_lifetime = 0 on this table removes the empty part from disk in the DETACH PART itself. Checked locally with the restart added after the test's statements: with the default setting the empty part survives and the restart logs 42 UNKNOWN_IDENTIFIER errors; with the setting it is gone before the restart and nothing is logged. The test output still matches the reference.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Version info

  • Merged into: 26.11.1.2077-master (included in 26.11 and later)
  • Backported to: 26.10.7.25

…in `04653`

`DETACH PART` leaves an empty covering part with the column list from before
the `RENAME COLUMN b TO d`. Its directory stays on disk for `old_parts_lifetime`
after cleanup outdates it, so a server restart within that time loads it as
active, and its mutation fails on `b` with `UNKNOWN_IDENTIFIER` until cleanup
drops it. `old_parts_lifetime = 0` removes it in the `DETACH PART` itself.

Closes: ClickHouse#120975
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118242&sha=28503f108eeecbd23581117b0f8117a33fd3e8ce&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
PR: ClickHouse#118242

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [219f26c]

Summary: ✅


AI Review

Summary

This PR hardens 04653_mutation_rewrite_stale_part_column_type against the Upgrade check failure mode by setting old_parts_lifetime = 0 for t_stale_part_type_5 and directly asserting that DETACH PART does not leave the zero-row covering part behind. That new assertion closes the earlier coverage gap around the restart-triggered UNKNOWN_IDENTIFIER burst, and I did not find any unresolved correctness, safety, or regression-coverage issues in the current diff.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 12, 2026
@tiandiwonder tiandiwonder added the can be tested Allows running workflows for external contributors label Oct 12, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 12, 2026
The rest of the section passes whether or not `old_parts_lifetime = 0` is set, so nothing here
would notice if that part started surviving again - which is the whole failure this test is the
carrier for. Assert it directly instead.

`StorageMergeTree::dropPart` ends with a synchronous `clearOldPartsFromFilesystem`, so with
`old_parts_lifetime = 0` the covering part is removed inside the `DETACH PART` statement and the
assertion needs no waiting. Without the setting the count is 1: the part survives a restart, is
loaded as active, and its mutation fails on the renamed-away `b`, which is the `UNKNOWN_IDENTIFIER`
burst `Upgrade check` reported.

Not filtered on `active` on purpose - the part is inactive, and the inactive-on-disk one is exactly
what gets revived.
@PedroTadim

Copy link
Copy Markdown
Member

@tiandiwonder can we merge this soon?

@tiandiwonder

Copy link
Copy Markdown
Contributor Author

@tiandiwonder can we merge this soon?

@PedroTadim would you please review?

@PedroTadim
PedroTadim added this pull request to the merge queue Nov 12, 2026
Merged via the queue into ClickHouse:master with commit cbe89c3 Nov 12, 2026
178 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 12, 2026
@PedroTadim

Copy link
Copy Markdown
Member

backporting to fix CI

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 19, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 19, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 19, 2026
Backport #125293 to 26.10: Fix `Upgrade check` errors from the empty part left by `DETACH PART` in `04653`
@clickhouse-gh clickhouse-gh Bot added comp-mutations ALTER UPDATE/DELETE and mutation execution over parts (including lightweight updates/deletes). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
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-mutations ALTER UPDATE/DELETE and mutation execution over parts (including lightweight updates/deletes). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade check: mutation of an empty DETACH PART tombstone revived by a restart retries UNKNOWN_IDENTIFIER until cleanup drops it

4 participants